Jaeger - #108
Conversation
📝 WalkthroughWalkthroughJaeger v1 adds WebAPI connection settings, service and dependency indexing, operations and trace data streams, OTLP trace parsing, index definitions, scopes, dashboards, and setup documentation. ChangesJaeger v1 integration
Sequence Diagram(s)sequenceDiagram
participant ServiceScope
participant TracesDataStream
participant JaegerQueryAPI
participant TracesScript
ServiceScope->>TracesDataStream: provide service ID
TracesDataStream->>JaegerQueryAPI: GET /api/v3/traces
JaegerQueryAPI-->>TracesDataStream: return OTLP JSON
TracesDataStream->>TracesScript: transform trace response
TracesScript-->>TracesDataStream: return flattened records
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@plugins/Jaeger/v1/dataStreams/dependencies.json`:
- Around line 20-28: Update the lookback fallback in the getArgs configuration
to 3600000 milliseconds when timeframe?.unixStart and timeframe?.unixEnd are
unavailable, while preserving the existing calculated duration for valid
timeframes.
In `@plugins/Jaeger/v1/docs/README.md`:
- Line 1: Start the README with a meaningful level-one Markdown heading
describing the Jaeger plugin or integration, then keep the existing introductory
description immediately after it.
In `@plugins/Jaeger/v1/indexDefinitions/default.json`:
- Around line 18-22: Update the dependencies index definition’s timeframe from
"none" to "last1hour" so dependency requests cover the full hourly schedule.
Leave the dependencies dataStream configuration unchanged.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: 43e8a4a2-653b-4fa0-bb4c-8dc38d23481d
⛔ Files ignored due to path filters (1)
plugins/Jaeger/v1/icon.pngis excluded by!**/*.png
📒 Files selected for processing (16)
plugins/Jaeger/v1/configValidation.jsonplugins/Jaeger/v1/cspell.jsonplugins/Jaeger/v1/custom_types.jsonplugins/Jaeger/v1/dataStreams/dependencies.jsonplugins/Jaeger/v1/dataStreams/operations.jsonplugins/Jaeger/v1/dataStreams/scripts/traces.jsplugins/Jaeger/v1/dataStreams/services.jsonplugins/Jaeger/v1/dataStreams/traces.jsonplugins/Jaeger/v1/defaultContent/manifest.jsonplugins/Jaeger/v1/defaultContent/overview.dash.jsonplugins/Jaeger/v1/defaultContent/scopes.jsonplugins/Jaeger/v1/defaultContent/service.dash.jsonplugins/Jaeger/v1/docs/README.mdplugins/Jaeger/v1/indexDefinitions/default.jsonplugins/Jaeger/v1/metadata.jsonplugins/Jaeger/v1/ui.json
| "getArgs": [ | ||
| { | ||
| "key": "endTs", | ||
| "value": "{{timeframe?.unixEnd ? timeframe.unixEnd * 1000 : Date.now()}}" | ||
| }, | ||
| { | ||
| "key": "lookback", | ||
| "value": "{{(timeframe?.unixStart && timeframe?.unixEnd) ? (timeframe.unixEnd - timeframe.unixStart) * 1000 : 1800000}}" | ||
| } |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Use the documented one-hour fallback.
When no timeframe exists, Line 27 sends a lookback of 1800000 ms. This selects 30 minutes. The README states that scheduled dependency indexing uses a one-hour trailing window.
Set the fallback to 3600000. Otherwise, scheduled imports omit dependency calls from half of the documented query window.
Proposed fix
- "value": "{{(timeframe?.unixStart && timeframe?.unixEnd) ? (timeframe.unixEnd - timeframe.unixStart) * 1000 : 1800000}}"
+ "value": "{{(timeframe?.unixStart && timeframe?.unixEnd) ? (timeframe.unixEnd - timeframe.unixStart) * 1000 : 3600000}}"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "getArgs": [ | |
| { | |
| "key": "endTs", | |
| "value": "{{timeframe?.unixEnd ? timeframe.unixEnd * 1000 : Date.now()}}" | |
| }, | |
| { | |
| "key": "lookback", | |
| "value": "{{(timeframe?.unixStart && timeframe?.unixEnd) ? (timeframe.unixEnd - timeframe.unixStart) * 1000 : 1800000}}" | |
| } | |
| "getArgs": [ | |
| { | |
| "key": "endTs", | |
| "value": "{{timeframe?.unixEnd ? timeframe.unixEnd * 1000 : Date.now()}}" | |
| }, | |
| { | |
| "key": "lookback", | |
| "value": "{{(timeframe?.unixStart && timeframe?.unixEnd) ? (timeframe.unixEnd - timeframe.unixStart) * 1000 : 3600000}}" | |
| } |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@plugins/Jaeger/v1/dataStreams/dependencies.json` around lines 20 - 28, Update
the lookback fallback in the getArgs configuration to 3600000 milliseconds when
timeframe?.unixStart and timeframe?.unixEnd are unavailable, while preserving
the existing calculated duration for valid timeframes.
| "name": "dependencies", | ||
| "dataStream": { | ||
| "name": "dependencies" | ||
| }, | ||
| "timeframe": "none", |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Use the one-hour dependency timeframe.
"timeframe": "none" causes the dependencies request to use its 30-minute fallback lookback. An hourly index schedule then leaves a 30-minute gap between runs. Use last1hour, which the dependency stream supports.
Proposed fix
- "timeframe": "none",
+ "timeframe": "last1hour",🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@plugins/Jaeger/v1/indexDefinitions/default.json` around lines 18 - 22, Update
the dependencies index definition’s timeframe from "none" to "last1hour" so
dependency requests cover the full hourly schedule. Leave the dependencies
dataStream configuration unchanged.
64c5a5d to
504d387
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
🧩 Plugin PR Summary📦 Modified Plugins
📋 Results
🔍 Validation Details✅
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@plugins/Jaeger/v1/dataStreams/scripts/traces.js`:
- Around line 27-36: Update attrsToObject to recursively convert every OTLP
AnyValue variant, including bytesValue, arrayValue elements, and kvlistValue
entries, while preserving existing scalar conversions. Ensure non-scalar values
remain present and correctly nested in serialized attributes, and add fixtures
covering each non-scalar variant.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: 4732ac9b-05c6-4a3a-bf2b-e890fb6deafd
⛔ Files ignored due to path filters (1)
plugins/Jaeger/v1/icon.pngis excluded by!**/*.png
📒 Files selected for processing (16)
plugins/Jaeger/v1/configValidation.jsonplugins/Jaeger/v1/cspell.jsonplugins/Jaeger/v1/custom_types.jsonplugins/Jaeger/v1/dataStreams/dependencies.jsonplugins/Jaeger/v1/dataStreams/operations.jsonplugins/Jaeger/v1/dataStreams/scripts/traces.jsplugins/Jaeger/v1/dataStreams/services.jsonplugins/Jaeger/v1/dataStreams/traces.jsonplugins/Jaeger/v1/defaultContent/manifest.jsonplugins/Jaeger/v1/defaultContent/overview.dash.jsonplugins/Jaeger/v1/defaultContent/scopes.jsonplugins/Jaeger/v1/defaultContent/service.dash.jsonplugins/Jaeger/v1/docs/README.mdplugins/Jaeger/v1/indexDefinitions/default.jsonplugins/Jaeger/v1/metadata.jsonplugins/Jaeger/v1/ui.json
| function attrsToObject(attributes) { | ||
| const obj = {}; | ||
| (attributes || []).forEach((a) => { | ||
| const value = a.value || {}; | ||
| obj[a.key] = | ||
| value.stringValue ?? | ||
| value.intValue ?? | ||
| value.doubleValue ?? | ||
| value.boolValue; | ||
| }); |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -eu
file="plugins/Jaeger/v1/dataStreams/scripts/traces.js"
printf '%s\n' "== target file =="
cat -n "$file" | sed -n '1,140p'
printf '%s\n' "== related Jaeger data-stream files =="
git ls-files 'plugins/Jaeger/v1/dataStreams/*' | sed -n '1,160p'
printf '%s\n' "== attrsToObject usages and attribute fixtures =="
rg -n -S 'attrsToObject|attributes|bytesValue|arrayValue|kvlistValue|intValue|doubleValue|boolValue' \
plugins/Jaeger/v1/dataStreams plugins/Jaeger/v1 2>/dev/null | sed -n '1,240p'Repository: squaredup/plugins
Length of output: 5749
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' "== traces data-stream schema around attributes =="
cat -n plugins/Jaeger/v1/dataStreams/traces.json | sed -n '80,125p'
printf '%s\n' "== plugin metadata and version references =="
fd -i 'metadata.json' plugins/Jaeger | while read -r f; do
printf '\n%s\n' "[$f]"
cat -n "$f" | sed -n '1,100p'
done
printf '%s\n' "== standalone behavior probe =="
node - <<'JS'
function attrsToObject(attributes) {
const obj = {};
(attributes || []).forEach((a) => {
const value = a.value || {};
obj[a.key] =
value.stringValue ??
value.intValue ??
value.doubleValue ??
value.boolValue;
});
return obj;
}
const input = [
{ key: "bytes", value: { bytesValue: "AQI=" } },
{
key: "array",
value: { arrayValue: { values: [
{ stringValue: "x" },
{ intValue: "7" }
] } }
},
{
key: "map",
value: { kvlistValue: { values: [
{ key: "nested", value: { boolValue: true } }
] } }
}
];
const output = attrsToObject(input);
console.log("object:", JSON.stringify(output));
console.log("bytes:", output.bytes);
console.log("array:", output.array);
console.log("map:", output.map);
console.log("serialized:", JSON.stringify({ attributes: output }));
JSRepository: squaredup/plugins
Length of output: 3210
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' "== changed files =="
git diff --name-only
printf '%s\n' "== change summary =="
git diff --stat
printf '%s\n' "== metadata change, if any =="
git diff -- plugins/Jaeger/v1/metadata.jsonRepository: squaredup/plugins
Length of output: 226
Preserve non-scalar OTLP attributes.
attrsToObject handles only scalar AnyValue variants. Valid bytesValue, arrayValue, and kvlistValue attributes become undefined, so JSON serialization omits them from the attributes field. Implement a recursive AnyValue converter and add fixtures for each non-scalar variant.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@plugins/Jaeger/v1/dataStreams/scripts/traces.js` around lines 27 - 36, Update
attrsToObject to recursively convert every OTLP AnyValue variant, including
bytesValue, arrayValue elements, and kvlistValue entries, while preserving
existing scalar conversions. Ensure non-scalar values remain present and
correctly nested in serialized attributes, and add fixtures covering each
non-scalar variant.
🔌 Plugin overview
🖼️ Plugin screenshots
Plugin configuration
to add
Default dashboards
to add
🧪 Testing
Tested end-to-end against a real deployed tenant, running against an actual on-prem Jaeger instance via the relay agent (not just structural validation).
servicesanddependenciesstreams directly viasquaredup testagainst live data, including diagnosing and fixing a real indexing failure: thedependenciesstream's original customlookbackparameter had no fallback, so when invoked byindexDefinitions/default.json(no dashboard tile context) it went out unbounded and timed out the connector. Switcheddependenciesover to the standard dashboardtimeframemechanism (matchingtraces) instead of a bespoke control, restricted tolast1hour–last7dayssince the dependency-graph query is comparatively expensive, and added a safe fallback for the timeframe-less indexing context.operationsandtracesverified directly against the live tenant.traces.js's OTLP decoding found during review: a duration-precision bug (rounding start/end to milliseconds independently before subtracting, rather than computing the duration in full nanosecond precision first) that could overstate short spans' duration by up to 1ms, and aSPAN_KINDdefault-value bug where proto3 JSON's omission of default-valued fields meant an INTERNAL/unspecified-kind span (very common) rendered as the literal string"undefined"instead of"UNSPECIFIED"./api/v3/tracesreturnstraceId/spanIdas hex strings, not base64 — so no conversion was needed there, despite that being a real risk for a generic OTLP-JSON consumer.Jaeger Service/Jaeger Dependency→Service/Dependency) to follow the platform's non-prefixed source-type convention, propagated consistently across every referencing file in one pass.📚 Checklist
Summary by CodeRabbit
Summary by CodeRabbit
New Features
Documentation