You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore: add editorconfig validation to linting (#7594)
* ci: add editorconfig validation to linting
This adds an editorconfig check to CI plus an `.editorconfig-checker.json`
ignore list for binary fixtures and recorded cassettes. The check runs
through the `mstruebing/editorconfig-checker` Docker image rather than the
npm binary so CI does not fetch the checker binary over the network on every
run.
* style: normalize files to satisfy editorconfig
Bring existing files into compliance with the editorconfig rules enforced by
the new check. Whitespace only: final newlines, LF line endings, trailing
whitespace, tabs converted to spaces, and indentation aligned to a multiple
of two.
* fix(test): keep streamtest fixture free of a trailing newline
The editorconfig normalization appended a final newline to the streamtest
fixture, which response_blocking.spec.js streams verbatim and asserts equals
'writefileend'. The extra byte made the streamed body 'writefile\nend' and
failed the no-attack case. Restore the fixture and carve it out of the
final-newline rule, matching the existing fine-tune.jsonl exclusion.
* test(llmobs): cover google-genai metrics and streaming output formatting
The `extractMetrics` token fallback (derive the total from prompt +
candidate counts when `totalTokenCount` is absent) and the streaming
special-case branch in `formatOutputMessages` (functionCall /
executableCode / codeExecutionResult parts routed through non-streaming
formatting) had no direct coverage. Add a unit spec pinning both
branches and their token-count siblings.
---------
Co-authored-by: Ruben Bridgewater <ruben.bridgewater@datadoghq.com>
2.**`npm pack`** when the published runtime artifact is what matters:
90
90
91
-
```bash
92
-
cd /tmp/<lib>-versions && npm pack <lib>@<x.y.z>
93
-
tar -xzf <lib>-<x.y.z>.tgz -C v<x.y.z> --strip-components=1
94
-
```
91
+
```bash
92
+
cd /tmp/<lib>-versions && npm pack <lib>@<x.y.z>
93
+
tar -xzf <lib>-<x.y.z>.tgz -C v<x.y.z> --strip-components=1
94
+
```
95
95
96
96
Read the file the wrap hooks, the base classes the hooked methods inherit from, and files the wrap doesn't currently touch — a public method, an internal channel, or a metadata field the current instrumentation skipped often gives a cleaner hook (e.g., kafka `cluster.brokerPool.metadata.clusterId`, couchbase `tracingChannel`).
97
97
@@ -156,20 +156,20 @@ For the complete list by base class, see [Reference Plugins](references/referenc
156
156
Follow these steps when creating or modifying an integration:
157
157
158
158
1.**Investigate** — Read the upstream library's source (see [Read Upstream Source First](#read-upstream-source-first)). Read 1-2 reference integrations of the same type (see table above). Understand the instrumentation and plugin patterns before writing code.
159
-
2.**Implement instrumentation** — Create the instrumentation in `packages/datadog-instrumentations/src/`. Use orchestrion for instrumentation.
159
+
2.**Implement instrumentation** — Create the instrumentation in `packages/datadog-instrumentations/src/`. Use orchestrion for instrumentation.
160
160
3.**Implement plugin** — Create the plugin in `packages/datadog-plugin-<name>/src/`. Extend the correct base class.
161
161
4.**Register** — Add entries in `packages/dd-trace/src/plugins/index.js`, `index.d.ts`, `docs/test.ts`, `docs/API.md`, and `.github/workflows/apm-integrations.yml`.
162
162
5.**Write tests** — Add unit tests and ESM integration tests. See [Testing](references/testing.md) for templates.
163
163
6.**Run tests** — Validate with:
164
-
```bash
165
-
# Run plugin tests (preferred CI command — handles yarn services automatically)
166
-
PLUGINS="<name>" npm run test:plugins:ci
164
+
```bash
165
+
# Run plugin tests (preferred CI command — handles yarn services automatically)
166
+
PLUGINS="<name>" npm run test:plugins:ci
167
167
168
-
# If the plugin needs external services (databases, message brokers, etc.),
169
-
# check docker-compose.yml for available service names, then:
168
+
# If the plugin needs external services (databases, message brokers, etc.),
169
+
# check docker-compose.yml for available service names, then:
170
170
docker compose up -d <service>
171
-
PLUGINS="<name>" npm run test:plugins:ci
172
-
```
171
+
PLUGINS="<name>" npm run test:plugins:ci
172
+
```
173
173
7.**Verify** — Confirm all tests pass before marking work as complete.
Copy file name to clipboardExpand all lines: .agents/skills/apm-integrations/references/orchestrion.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -162,9 +162,9 @@ This pattern is complex and easy to get wrong. The reference document covers:
162
162
163
163
1. Install the package: `npm install <package>`
164
164
2. Search for the method definition:
165
-
```bash
166
-
grep -r "methodName" node_modules/<package>/
167
-
```
165
+
```bash
166
+
grep -r "methodName" node_modules/<package>/
167
+
```
168
168
3. Use the path relative to the package root
169
169
170
170
**IMPORTANT: Patch both CJS and ESM code paths.** Many libraries duplicate their classes across separate CJS and ESM builds (e.g., `dist/cjs/client.js` and `dist/esm/client.js`). Each file path needs its own entry in the instrumentations array with the same `functionQuery` and `channelName`. If only one is patched, the instrumentation will silently fail for the other module format.
0 commit comments