Skip to content

Commit 12862ed

Browse files
committed
fix remaining issues
1 parent 74944b7 commit 12862ed

13 files changed

Lines changed: 95 additions & 94 deletions

File tree

.agents/skills/llmobs-integration/SKILL.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,16 @@ See [references/plugin-architecture.md](references/plugin-architecture.md) for c
9393
Answer these questions by reading the code:
9494

9595
1. **Does the package make direct HTTP calls to LLM provider endpoints?**
96-
- YES → Go to question 2
97-
- NO → Go to question 3
96+
- YES → Go to question 2
97+
- NO → Go to question 3
9898

9999
2. **Does it support multiple LLM providers via configuration?**
100-
- YES → **`LlmObsCategory.MULTI_PROVIDER`**
101-
- NO → **`LlmObsCategory.LLM_CLIENT`**
100+
- YES → **`LlmObsCategory.MULTI_PROVIDER`**
101+
- NO → **`LlmObsCategory.LLM_CLIENT`**
102102

103103
3. **Does it implement workflow/graph orchestration with state management?**
104-
- YES → **`LlmObsCategory.ORCHESTRATION`**
105-
- NO → **`LlmObsCategory.INFRASTRUCTURE`**
104+
- YES → **`LlmObsCategory.ORCHESTRATION`**
105+
- NO → **`LlmObsCategory.INFRASTRUCTURE`**
106106

107107
See [references/category-detection.md](references/category-detection.md) for detailed heuristics and examples.
108108

@@ -138,31 +138,31 @@ See [references/message-extraction.md](references/message-extraction.md) for pro
138138
## Implementation Steps
139139

140140
1. **Detect package category** (REQUIRED FIRST STEP)
141-
- Follow decision tree above
142-
- Output: category, confidence, reasoning
141+
- Follow decision tree above
142+
- Output: category, confidence, reasoning
143143

144144
2. **Create plugin file**
145-
- Location: `packages/dd-trace/src/llmobs/plugins/{integration}/index.js`
146-
- Extend: `LLMObsPlugin` base class
147-
- Implement: Required methods per plugin architecture
145+
- Location: `packages/dd-trace/src/llmobs/plugins/{integration}/index.js`
146+
- Extend: `LLMObsPlugin` base class
147+
- Implement: Required methods per plugin architecture
148148

149149
3. **Implement `getLLMObsSpanRegisterOptions(ctx)`**
150-
- Extract model provider and name from context
151-
- Determine span kind (usually `'llm'`)
152-
- Return registration options object
150+
- Extract model provider and name from context
151+
- Determine span kind (usually `'llm'`)
152+
- Return registration options object
153153

154154
4. **Implement `setLLMObsTags(ctx)`**
155-
- Extract input messages from `ctx.arguments`
156-
- Extract output messages from `ctx.result`
157-
- Extract token metrics (input_tokens, output_tokens, total_tokens)
158-
- Extract metadata (temperature, max_tokens, etc.)
159-
- Tag span using `this._tagger` methods
155+
- Extract input messages from `ctx.arguments`
156+
- Extract output messages from `ctx.result`
157+
- Extract token metrics (input_tokens, output_tokens, total_tokens)
158+
- Extract metadata (temperature, max_tokens, etc.)
159+
- Tag span using `this._tagger` methods
160160

161161
5. **Handle edge cases**
162-
- Streaming responses (if applicable)
163-
- Error cases (empty output messages)
164-
- Non-standard message formats
165-
- Missing metadata
162+
- Streaming responses (if applicable)
163+
- Error cases (empty output messages)
164+
- Non-standard message formats
165+
- Missing metadata
166166

167167
See [references/plugin-architecture.md](references/plugin-architecture.md) for step-by-step implementation guide.
168168

.agents/skills/llmobs-integration/references/category-detection.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,16 @@ Follow this tree to determine category:
8787

8888
```
8989
1. Does the package make direct HTTP calls to LLM provider endpoints?
90-
├─ YES → Go to question 2
91-
└─ NO → Go to question 3
90+
├─ YES → Go to question 2
91+
└─ NO → Go to question 3
9292
9393
2. Does it support multiple LLM providers via configuration?
94-
├─ YES → LlmObsCategory.MULTI_PROVIDER
95-
└─ NO → LlmObsCategory.LLM_CLIENT
94+
├─ YES → LlmObsCategory.MULTI_PROVIDER
95+
└─ NO → LlmObsCategory.LLM_CLIENT
9696
9797
3. Does it implement workflow/graph orchestration with state management?
98-
├─ YES → LlmObsCategory.ORCHESTRATION
99-
└─ NO → LlmObsCategory.INFRASTRUCTURE
98+
├─ YES → LlmObsCategory.ORCHESTRATION
99+
└─ NO → LlmObsCategory.INFRASTRUCTURE
100100
```
101101

102102
## Detection Process

.agents/skills/llmobs-testing/references/assertion-helpers.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -99,34 +99,34 @@ assertLlmObsSpanEvent(events[0], {
9999
## Best Practices
100100

101101
1. **Use MOCK_* for non-deterministic values:**
102-
- Output text: `MOCK_STRING` (real responses vary)
103-
- Token counts: `MOCK_NOT_NULLISH` (counts vary but should exist)
104-
- Error objects: `MOCK_OBJECT` (error details vary)
102+
- Output text: `MOCK_STRING` (real responses vary)
103+
- Token counts: `MOCK_NOT_NULLISH` (counts vary but should exist)
104+
- Error objects: `MOCK_OBJECT` (error details vary)
105105

106106
2. **Use exact values for inputs:**
107-
- Input messages: You control these in tests
108-
- Model parameters: You set these (temperature, max_tokens)
109-
- Model name: You specify this
107+
- Input messages: You control these in tests
108+
- Model parameters: You set these (temperature, max_tokens)
109+
- Model name: You specify this
110110

111111
3. **Always validate core fields:**
112-
- `spanKind` (required for every span)
113-
- `name` (operation identifier)
114-
- `modelName` and `modelProvider` (for LLM spans)
112+
- `spanKind` (required for every span)
113+
- `name` (operation identifier)
114+
- `modelName` and `modelProvider` (for LLM spans)
115115

116116
4. **Validate message format:**
117-
- Ensure `{content: string, role: string}` structure
118-
- Check role values: `'user'`, `'assistant'`, `'system'`, `'tool'`
117+
- Ensure `{content: string, role: string}` structure
118+
- Check role values: `'user'`, `'assistant'`, `'system'`, `'tool'`
119119

120120
5. **Test error paths:**
121-
- Verify empty `outputMessages: [{content: '', role: ''}]` on errors
122-
- Assert `error` field exists with `MOCK_OBJECT`
121+
- Verify empty `outputMessages: [{content: '', role: ''}]` on errors
122+
- Assert `error` field exists with `MOCK_OBJECT`
123123

124124
6. **Match span kind to operation:**
125-
- Chat/completions → `spanKind: 'llm'`
126-
- Workflow execution → `spanKind: 'workflow'`
127-
- Agent runs → `spanKind: 'agent'`
128-
- Tool calls → `spanKind: 'tool'`
129-
- Embeddings → `spanKind: 'embedding'`
125+
- Chat/completions → `spanKind: 'llm'`
126+
- Workflow execution → `spanKind: 'workflow'`
127+
- Agent runs → `spanKind: 'agent'`
128+
- Tool calls → `spanKind: 'tool'`
129+
- Embeddings → `spanKind: 'embedding'`
130130

131131
## Reference Test Implementation
132132

.editorconfig-checker.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"Exclude": [
88
"LICENSE",
99
"LICENSE.*",
10+
"packages/dd-trace/test/llmobs/cassettes",
1011
"vendor"
1112
],
1213
"AllowedContentTypes": [],

eslint-rules/eslint-env-aliases.test.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ ruleTester.run('eslint-env-aliases', rule, {
2121
output: "const env = 'DD_PROFILING_CPU_ENABLED'",
2222
errors: [{
2323
message: "Use canonical environment variable name 'DD_PROFILING_CPU_ENABLED' " +
24-
"instead of alias 'DD_PROFILING_EXPERIMENTAL_CPU_ENABLED'",
24+
"instead of alias 'DD_PROFILING_EXPERIMENTAL_CPU_ENABLED'",
2525
}],
2626
},
2727
{
2828
code: 'const env = `DD_TRACE_EXPERIMENTAL_RUNTIME_ID_ENABLED`',
2929
output: "const env = 'DD_RUNTIME_METRICS_RUNTIME_ID_ENABLED'",
3030
errors: [{
3131
message: "Use canonical environment variable name 'DD_RUNTIME_METRICS_RUNTIME_ID_ENABLED' " +
32-
"instead of alias 'DD_TRACE_EXPERIMENTAL_RUNTIME_ID_ENABLED'",
32+
"instead of alias 'DD_TRACE_EXPERIMENTAL_RUNTIME_ID_ENABLED'",
3333
}],
3434
},
3535
],

integration-tests/coverage/README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,27 @@ All sources live in `integration-tests/coverage/`.
2020

2121
```md
2222
npm run test:integration:mocha:coverage
23-
24-
23+
24+
2525
integration-tests/coverage/run-suite.js
26-
│ (spawns mocha with --require register.js)
27-
26+
│ (spawns mocha with --require register.js)
27+
2828
register.js ──▶ patch-child-process.js (monkey-patches child_process)
29-
30-
▼ createSandbox → packTarballWithLock
29+
30+
▼ createSandbox → packTarballWithLock
3131
pack-instrumented-tarball.js
32-
│ (bun pm pack → extract → istanbul instrument → sentinel → tar -czf)
33-
▼ each spawn/fork/exec of Node
32+
│ (bun pm pack → extract → istanbul instrument → sentinel → tar -czf)
33+
▼ each spawn/fork/exec of Node
3434
child-bootstrap.js ──▶ require('nyc').wrap() [hookRequire: false]
35-
│ (child runs, writes raw coverage JSON to per-sandbox temp dir)
36-
35+
│ (child runs, writes raw coverage JSON to per-sandbox temp dir)
36+
3737
useSandbox teardown
38-
39-
38+
39+
4040
finalize-sandbox.js (reads sandbox JSON, rebases paths to repo root,
41-
writes coverage into the collector)
42-
43-
41+
writes coverage into the collector)
42+
43+
4444
merge-lcov.js (called by run-suite.js after mocha exits; merges every
4545
sandbox into coverage/node-<version>-<script>/lcov.info)
4646
```

integration-tests/jest/jest.spec.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7479,11 +7479,11 @@ describe(`jest@${JEST_VERSION} commonJS`, () => {
74797479
fs.writeFileSync(
74807480
path.join(cwd, 'ci-visibility/test-management/test-worker-restart-z-impacted.js'),
74817481
`const assert = require('assert')
7482-
describe('worker restart impacted tests', () => {
7483-
it('can pass normally', () => {
7484-
assert.strictEqual(1 + 2, 3)
7485-
})
7486-
})`
7482+
describe('worker restart impacted tests', () => {
7483+
it('can pass normally', () => {
7484+
assert.strictEqual(1 + 2, 3)
7485+
})
7486+
})`
74877487
)
74887488
execSync('git add ci-visibility/test-management/test-worker-restart-z-impacted.js', { cwd, stdio: 'ignore' })
74897489
execSync('git commit --amend --no-edit', { cwd, stdio: 'ignore' })

integration-tests/playwright/playwright-impacted-tests.spec.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -105,24 +105,24 @@ versions.forEach((version) => {
105105
path.join(cwd, 'ci-visibility/playwright-tests-impacted-tests/impacted-test.js'),
106106
`const { test, expect } = require('@playwright/test')
107107
108-
test.beforeEach(async ({ page }) => {
109-
await page.goto(process.env.PW_BASE_URL)
110-
})
111-
112-
test.describe('impacted test', () => {
113-
test('should be impacted', async ({ page }) => {
114-
await expect(page.locator('.hello-world')).toHaveText([
115-
'Hello Worldd'
116-
])
117-
})
118-
})
119-
test.describe('impacted test 2', () => {
120-
test('should be impacted 2', async ({ page }) => {
121-
await expect(page.locator('.hello-world')).toHaveText([
122-
'Hello World'
123-
])
124-
})
125-
})`
108+
test.beforeEach(async ({ page }) => {
109+
await page.goto(process.env.PW_BASE_URL)
110+
})
111+
112+
test.describe('impacted test', () => {
113+
test('should be impacted', async ({ page }) => {
114+
await expect(page.locator('.hello-world')).toHaveText([
115+
'Hello Worldd'
116+
])
117+
})
118+
})
119+
test.describe('impacted test 2', () => {
120+
test('should be impacted 2', async ({ page }) => {
121+
await expect(page.locator('.hello-world')).toHaveText([
122+
'Hello World'
123+
])
124+
})
125+
})`
126126
)
127127
execSync('git add ci-visibility/playwright-tests-impacted-tests/impacted-test.js', { cwd, stdio: 'ignore' })
128128
execSync('git commit -m "modify impacted-test.js" --no-verify', { cwd, stdio: 'ignore' })

packages/datadog-instrumentations/src/mocha/main.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -692,9 +692,9 @@ addHook({
692692
shimmer.wrap(BufferedWorkerPool.prototype, 'run', run => async function (testSuiteAbsolutePath, workerArgs) {
693693
if (!testFinishCh.hasSubscribers ||
694694
(!config.isKnownTestsEnabled &&
695-
!config.isTestManagementTestsEnabled &&
696-
!config.isImpactedTestsEnabled &&
697-
!config.isFlakyTestRetriesEnabled)) {
695+
!config.isTestManagementTestsEnabled &&
696+
!config.isImpactedTestsEnabled &&
697+
!config.isFlakyTestRetriesEnabled)) {
698698
return run.apply(this, arguments)
699699
}
700700

packages/dd-trace/src/opentracing/propagation/text_map.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ class TextMapPropagator {
818818
(!tracestateSamplingPriority || tracestateSamplingPriority >= 0)) {
819819
samplingPriority = AUTO_REJECT
820820
} else if (traceparentSampled === 1 &&
821-
(!tracestateSamplingPriority || tracestateSamplingPriority < 0)) {
821+
(!tracestateSamplingPriority || tracestateSamplingPriority < 0)) {
822822
samplingPriority = AUTO_KEEP
823823
}
824824
}

0 commit comments

Comments
 (0)