Skip to content

Commit

Permalink
Merge branch 'main' into uploading_otlp_traces
Browse files Browse the repository at this point in the history
  • Loading branch information
yurishkuro committed Mar 4, 2024
2 parents 2bd3a2f + aba6c2c commit 1e33ca7
Show file tree
Hide file tree
Showing 12 changed files with 465 additions and 307 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
cache: yarn
node-version: '18'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
cache: yarn
node-version: '18'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
cache: yarn
node-version: '18'
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
},
"devDependencies": {
"@babel/eslint-parser": "^7.23.10",
"@typescript-eslint/eslint-plugin": "6.21.0",
"@typescript-eslint/parser": "6.21.0",
"eslint": "8.56.0",
"@typescript-eslint/eslint-plugin": "7.1.0",
"@typescript-eslint/parser": "7.1.0",
"eslint": "8.57.0",
"eslint-config-airbnb": "19.0.4",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-react": "7.33.2",
"husky": "8.0.3",
"husky": "9.0.10",
"jsdom": "24.0.0",
"npm-run-all": "4.1.5",
"prettier": "3.2.4",
Expand Down
6 changes: 3 additions & 3 deletions packages/jaeger-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@types/redux-actions": "2.2.1",
"@types/object-hash": "^3.0.2",
"@types/rollup-plugin-visualizer": "^4.2.1",
"@vitejs/plugin-legacy": "^5.3.0",
"@vitejs/plugin-legacy": "^5.3.1",
"@vitejs/plugin-react": "^4.2.1",
"@wojtekmaj/enzyme-adapter-react-17": "^0.8.0",
"babel-jest": "^29.5.0",
Expand All @@ -43,7 +43,7 @@
"rollup-plugin-visualizer": "^5.11.0",
"sinon": "^17.0.0",
"terser": "^5.26.0",
"vite": "^5.0.12",
"vite": "^5.1.4",
"vite-plugin-imp": "^2.3.1"
},
"dependencies": {
Expand All @@ -68,7 +68,7 @@
"memoize-one": "^6.0.0",
"object-hash": "^3.0.0",
"prop-types": "^15.5.10",
"query-string": "^8.1.0",
"query-string": "^9.0.0",
"raven-js": "^3.22.1",
"react": "^18.2.0",
"react-circular-progressbar": "^2.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ limitations under the License.
}

.KeyValueTable--copyColumn {
white-space: nowrap;
text-align: right;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ describe('<KeyValuesTable>', () => {
{ key: 'omg', value: 'mos-def', expected: 'mos-def' },
{ key: 'numericString', value: '12345678901234567890', expected: '12345678901234567890' },
{ key: 'numeric', value: 123456789, expected: '123456789' },
{ key: 'boolean', value: true, expected: 'true' },
{ key: 'http.request.header.accept', value: ['application/json'], expected: 'application/json' },
{
key: 'http.response.header.set_cookie',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,27 @@ const stringListMarkup = (value: any[]) => (
</div>
);

const stringMarkup = (value: string) => (
<div className="json-markup">
<span className="json-markup-string">{value}</span>
</div>
);
const scalarMarkup = (value: string | Number | Boolean) => {
let className;
switch (typeof value) {
case 'boolean': {
className = 'json-markup-bool';
break;
}
case 'number': {
className = 'json-markup-number';
break;
}
default: {
className = 'json-markup-string';
}
}
return (
<div className="json-markup">
<span className={className}>{value.toString()}</span>
</div>
);
};

function formatValue(key: string, value: any) {
let content;
Expand All @@ -66,11 +82,9 @@ function formatValue(key: string, value: any) {
parsed = tryParseJson(value);
}

if (typeof parsed === 'string') {
content = stringMarkup(parsed);
} else if (Array.isArray(parsed) && shouldDisplayAsStringList(key)) {
if (Array.isArray(parsed) && shouldDisplayAsStringList(key)) {
content = stringListMarkup(parsed);
} else {
} else if (typeof parsed === 'object') {
const shouldJsonTreeExpand = Object.keys(parsed).length <= 10;

content = (
Expand All @@ -95,6 +109,8 @@ function formatValue(key: string, value: any) {
}}
/>
);
} else {
content = scalarMarkup(parsed);
}

return <div className="ub-inline-block">{content}</div>;
Expand Down
14 changes: 14 additions & 0 deletions packages/jaeger-ui/src/utils/filter-spans.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,16 @@ describe('filterSpans', () => {
},
],
};

// span3 contain empty logs
const spanID3 = 'span-id-3';
const span3 = {
spanID: spanID3,
operationName: 'operationName3',
process: {
serviceName: 'serviceName3',
},
};
const spans = [span0, span2];

it('should return `null` if spans is falsy', () => {
Expand Down Expand Up @@ -242,6 +252,10 @@ describe('filterSpans', () => {
expect(filterSpans('"processTag Value3" -processTagKey3', spans)).toEqual(new Set());
});

it("span without log shouldn't break filtering", () => {
expect(filterSpans('operationName2', [span2, span3])).toEqual(new Set([spanID2]));
});

// This test may false positive if other tests are failing
it('should return an empty set if no spans match the filter', () => {
expect(filterSpans('-processTagKey1', spans)).toEqual(new Set());
Expand Down
2 changes: 1 addition & 1 deletion packages/jaeger-ui/src/utils/filter-spans.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default function filterSpans(textFilter: string, spans: Span[] | TNil) {
isTextInFilters(includeFilters, span.operationName) ||
isTextInFilters(includeFilters, span.process.serviceName) ||
isTextInKeyValues(span.tags) ||
(span.logs !== null && span.logs.some(log => isTextInKeyValues(log.fields))) ||
(Array.isArray(span.logs) && span.logs.some(log => isTextInKeyValues(log.fields))) ||
isTextInKeyValues(span.process.tags) ||
includeFilters.some(filter => filter.replace(/^0*/, '') === span.spanID.replace(/^0*/, ''));

Expand Down
8 changes: 4 additions & 4 deletions packages/plexus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
"@types/d3-zoom": "3.0.8",
"@types/react": "^18.2.48",
"@types/react-dom": "18.2.5",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"@typescript-eslint/eslint-plugin": "^7.1.0",
"@typescript-eslint/parser": "^7.1.0",
"babel-loader": "9.1.3",
"babel-plugin-transform-react-remove-prop-types": "0.4.24",
"clean-webpack-plugin": "4.0.0",
"css-loader": "6.8.1",
"css-loader": "6.10.0",
"eslint-config-prettier": "^9.1.0",
"file-loader": "6.2.0",
"html-loader": "5.0.0",
Expand All @@ -42,7 +42,7 @@
"url-loader": "4.1.1",
"webpack": "^5.90.1",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.11.1",
"webpack-dev-server": "^5.0.1",
"webpack-node-externals": "3.0.0",
"worker-loader": "3.0.8"
},
Expand Down
Loading

0 comments on commit 1e33ca7

Please sign in to comment.