From e603f23c4ce0732f6b9def395bc7a5a76ea1846e Mon Sep 17 00:00:00 2001 From: pavelpashkovsky Date: Fri, 5 Aug 2022 11:09:16 +0300 Subject: [PATCH 1/3] feat: flamegraph visualization Signed-off-by: pavelpashkovsky --- packages/jaeger-ui/package.json | 1 + .../TracePage/TraceFlamegraph/index.css | 18 +++++++++++ .../TracePage/TraceFlamegraph/index.tsx | 30 +++++++++++++++++++ .../TracePageHeader/AltViewOptions.tsx | 4 +++ .../__snapshots__/AltViewOptions.test.js.snap | 8 +++++ .../src/components/TracePage/index.tsx | 3 ++ .../src/components/TracePage/types.tsx | 1 + yarn.lock | 5 ++++ 8 files changed, 70 insertions(+) create mode 100644 packages/jaeger-ui/src/components/TracePage/TraceFlamegraph/index.css create mode 100644 packages/jaeger-ui/src/components/TracePage/TraceFlamegraph/index.tsx diff --git a/packages/jaeger-ui/package.json b/packages/jaeger-ui/package.json index 8869371acd..56cfcff500 100644 --- a/packages/jaeger-ui/package.json +++ b/packages/jaeger-ui/package.json @@ -42,6 +42,7 @@ }, "dependencies": { "@jaegertracing/plexus": "0.2.0", + "@pyroscope/flamegraph": "0.17.2", "@types/classnames": "^2.2.7", "@types/deep-freeze": "^0.1.1", "@types/history": "^4.7.2", diff --git a/packages/jaeger-ui/src/components/TracePage/TraceFlamegraph/index.css b/packages/jaeger-ui/src/components/TracePage/TraceFlamegraph/index.css new file mode 100644 index 0000000000..8c4a81f62e --- /dev/null +++ b/packages/jaeger-ui/src/components/TracePage/TraceFlamegraph/index.css @@ -0,0 +1,18 @@ +/* +Copyright (c) 2017 Uber Technologies, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +.Flamegraph-wrapper { + padding: 0 calc(1rem - 5px); +} diff --git a/packages/jaeger-ui/src/components/TracePage/TraceFlamegraph/index.tsx b/packages/jaeger-ui/src/components/TracePage/TraceFlamegraph/index.tsx new file mode 100644 index 0000000000..095b1a892f --- /dev/null +++ b/packages/jaeger-ui/src/components/TracePage/TraceFlamegraph/index.tsx @@ -0,0 +1,30 @@ +// Copyright (c) 2017 Uber Technologies, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +import React from 'react'; +import { FlamegraphRenderer, convertJaegerTraceToProfile } from '@pyroscope/flamegraph'; + +import '@pyroscope/flamegraph/dist/index.css'; +import './index.css'; + +const TraceFlamegraph = ({ trace }: any) => { + const convertedProfile = convertJaegerTraceToProfile(trace.data); + + return ( +
+ +
+ ); +}; + +export default TraceFlamegraph; diff --git a/packages/jaeger-ui/src/components/TracePage/TracePageHeader/AltViewOptions.tsx b/packages/jaeger-ui/src/components/TracePage/TracePageHeader/AltViewOptions.tsx index d08d908760..4bd5d88d01 100644 --- a/packages/jaeger-ui/src/components/TracePage/TracePageHeader/AltViewOptions.tsx +++ b/packages/jaeger-ui/src/components/TracePage/TracePageHeader/AltViewOptions.tsx @@ -51,6 +51,10 @@ const MENU_ITEMS = [ viewType: ETraceViewType.TraceSpansView, label: 'Trace Spans Table', }, + { + viewType: ETraceViewType.TraceFlamegraph, + label: 'Trace Flamegraph', + }, ]; export default function AltViewOptions(props: Props) { diff --git a/packages/jaeger-ui/src/components/TracePage/TracePageHeader/__snapshots__/AltViewOptions.test.js.snap b/packages/jaeger-ui/src/components/TracePage/TracePageHeader/__snapshots__/AltViewOptions.test.js.snap index 92af781600..39b7c0c02d 100644 --- a/packages/jaeger-ui/src/components/TracePage/TracePageHeader/__snapshots__/AltViewOptions.test.js.snap +++ b/packages/jaeger-ui/src/components/TracePage/TracePageHeader/__snapshots__/AltViewOptions.test.js.snap @@ -35,6 +35,14 @@ exports[`AltViewOptions renders correctly 1`] = ` Trace Spans Table + + + Trace Flamegraph + + { view = ; } else if (ETraceViewType.TraceSpansView === viewType && headerHeight) { view = ; + } else if (ETraceViewType.TraceFlamegraph === viewType && headerHeight) { + view = ; } return ( diff --git a/packages/jaeger-ui/src/components/TracePage/types.tsx b/packages/jaeger-ui/src/components/TracePage/types.tsx index 8a11f6bed1..7a90b65c0e 100644 --- a/packages/jaeger-ui/src/components/TracePage/types.tsx +++ b/packages/jaeger-ui/src/components/TracePage/types.tsx @@ -61,4 +61,5 @@ export enum ETraceViewType { TraceGraph = 'TraceGraph', TraceStatistics = 'TraceStatistics', TraceSpansView = 'TraceSpansView', + TraceFlamegraph = 'TraceFlamegraph', } diff --git a/yarn.lock b/yarn.lock index d49477b4cf..142539f670 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1517,6 +1517,11 @@ universal-user-agent "^2.0.0" url-template "^2.0.8" +"@pyroscope/flamegraph@0.17.2": + version "0.17.2" + resolved "https://registry.yarnpkg.com/@pyroscope/flamegraph/-/flamegraph-0.17.2.tgz#b8d95e9d8de9526fa79339690869e8c2c1c5e75e" + integrity sha512-dS4yvX9n61f7SqXhsZnkl7SM03d6DtXy1KRnlHbiLb1IwyiV9iHazQdkaTcQHOu90go2I2JkxCJlT+/O9kyz0A== + "@sinonjs/commons@^1", "@sinonjs/commons@^1.0.2", "@sinonjs/commons@^1.4.0": version "1.4.0" resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.4.0.tgz#7b3ec2d96af481d7a0321252e7b1c94724ec5a78" From 821cfa3cc95e044ec9eb4dd5e0501cd8699cae78 Mon Sep 17 00:00:00 2001 From: pavelpashkovsky Date: Mon, 8 Aug 2022 11:56:01 +0300 Subject: [PATCH 2/3] fix: updated copyright Signed-off-by: pavelpashkovsky --- .../src/components/TracePage/TraceFlamegraph/index.css | 2 +- .../src/components/TracePage/TraceFlamegraph/index.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/jaeger-ui/src/components/TracePage/TraceFlamegraph/index.css b/packages/jaeger-ui/src/components/TracePage/TraceFlamegraph/index.css index 8c4a81f62e..bb6696e428 100644 --- a/packages/jaeger-ui/src/components/TracePage/TraceFlamegraph/index.css +++ b/packages/jaeger-ui/src/components/TracePage/TraceFlamegraph/index.css @@ -1,5 +1,5 @@ /* -Copyright (c) 2017 Uber Technologies, Inc. +Copyright (c) 2022 The Jaeger Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/packages/jaeger-ui/src/components/TracePage/TraceFlamegraph/index.tsx b/packages/jaeger-ui/src/components/TracePage/TraceFlamegraph/index.tsx index 095b1a892f..a0f909a1ac 100644 --- a/packages/jaeger-ui/src/components/TracePage/TraceFlamegraph/index.tsx +++ b/packages/jaeger-ui/src/components/TracePage/TraceFlamegraph/index.tsx @@ -1,4 +1,4 @@ -// Copyright (c) 2017 Uber Technologies, Inc. +// Copyright (c) 2022 The Jaeger Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. From cef24ccd43dd104221b7c291b1985341a9553d5a Mon Sep 17 00:00:00 2001 From: pavelpashkovsky Date: Wed, 10 Aug 2022 17:28:33 +0300 Subject: [PATCH 3/3] chore: added convertJaegerTraceToProfile test, basic UI test, snapshot Signed-off-by: pavelpashkovsky --- packages/jaeger-ui/package.json | 2 +- .../__snapshots__/index.test.js.snap | 65 ++ .../TracePage/TraceFlamegraph/index.test.js | 71 ++ .../TracePage/TraceFlamegraph/index.tsx | 2 +- .../TracePage/TraceFlamegraph/testTrace.json | 784 ++++++++++++++++++ yarn.lock | 8 +- 6 files changed, 926 insertions(+), 6 deletions(-) create mode 100644 packages/jaeger-ui/src/components/TracePage/TraceFlamegraph/__snapshots__/index.test.js.snap create mode 100644 packages/jaeger-ui/src/components/TracePage/TraceFlamegraph/index.test.js create mode 100644 packages/jaeger-ui/src/components/TracePage/TraceFlamegraph/testTrace.json diff --git a/packages/jaeger-ui/package.json b/packages/jaeger-ui/package.json index 56cfcff500..e038a49949 100644 --- a/packages/jaeger-ui/package.json +++ b/packages/jaeger-ui/package.json @@ -42,7 +42,7 @@ }, "dependencies": { "@jaegertracing/plexus": "0.2.0", - "@pyroscope/flamegraph": "0.17.2", + "@pyroscope/flamegraph": "0.18.4-1379-557f0b4.0", "@types/classnames": "^2.2.7", "@types/deep-freeze": "^0.1.1", "@types/history": "^4.7.2", diff --git a/packages/jaeger-ui/src/components/TracePage/TraceFlamegraph/__snapshots__/index.test.js.snap b/packages/jaeger-ui/src/components/TracePage/TraceFlamegraph/__snapshots__/index.test.js.snap new file mode 100644 index 0000000000..e2b7c59355 --- /dev/null +++ b/packages/jaeger-ui/src/components/TracePage/TraceFlamegraph/__snapshots__/index.test.js.snap @@ -0,0 +1,65 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` renders as expected 1`] = ` +
+ +
+`; diff --git a/packages/jaeger-ui/src/components/TracePage/TraceFlamegraph/index.test.js b/packages/jaeger-ui/src/components/TracePage/TraceFlamegraph/index.test.js new file mode 100644 index 0000000000..41ddcf8ef4 --- /dev/null +++ b/packages/jaeger-ui/src/components/TracePage/TraceFlamegraph/index.test.js @@ -0,0 +1,71 @@ +// Copyright (c) 2022 The Jaeger Authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import React from 'react'; +import { shallow } from 'enzyme'; +import { convertJaegerTraceToProfile } from '@pyroscope/flamegraph'; + +import TraceFlamegraph from './index'; + +const testTrace = require('./testTrace.json'); + +const profile = convertJaegerTraceToProfile(testTrace.data); + +describe('convertJaegerTraceToProfile', () => { + it('returns correct profile format', () => { + expect(profile.version).toBe(1); + + expect(Array.isArray(profile.flamebearer.levels)).toBe(true); + expect(profile.flamebearer.levels[0].every(el => typeof el === 'number')).toBe(true); + expect(Array.isArray(profile.flamebearer.names)).toBe(true); + expect(profile.flamebearer.names.every(el => typeof el === 'string')).toBe(true); + expect(typeof profile.flamebearer.numTicks).toBe('number'); + + expect(typeof profile.metadata.format).toBe('string'); + expect(typeof profile.metadata.sampleRate).toBe('number'); + expect(typeof profile.metadata.spyName).toBe('string'); + expect(typeof profile.metadata.units).toBe('string'); + }); +}); + +describe('', () => { + let wrapper; + + beforeEach(() => { + const props = { trace: testTrace }; + wrapper = shallow(); + }); + + it('renders as expected', () => { + expect(wrapper).toMatchSnapshot(); + }); + + it('does not explode', () => { + expect(wrapper).toBeDefined(); + expect(wrapper.find('.Flamegraph-wrapper').length).toBe(1); + }); + + it('renders profile table and flamegraph', () => { + expect(wrapper).toBeDefined(); + expect(wrapper.html().includes('flamegraph-table')).toBe(true); + expect(wrapper.html().includes('flamegraph-view')).toBe(true); + }); + + it('may show no profile', () => { + const props = {}; + wrapper = shallow(); + expect(wrapper).toBeDefined(); + expect(wrapper.html().includes('no-profiling-data')).toBe(true); + }); +}); diff --git a/packages/jaeger-ui/src/components/TracePage/TraceFlamegraph/index.tsx b/packages/jaeger-ui/src/components/TracePage/TraceFlamegraph/index.tsx index a0f909a1ac..5d4a5e7a5c 100644 --- a/packages/jaeger-ui/src/components/TracePage/TraceFlamegraph/index.tsx +++ b/packages/jaeger-ui/src/components/TracePage/TraceFlamegraph/index.tsx @@ -18,7 +18,7 @@ import '@pyroscope/flamegraph/dist/index.css'; import './index.css'; const TraceFlamegraph = ({ trace }: any) => { - const convertedProfile = convertJaegerTraceToProfile(trace.data); + const convertedProfile = trace && trace.data ? convertJaegerTraceToProfile(trace.data) : null; return (
diff --git a/packages/jaeger-ui/src/components/TracePage/TraceFlamegraph/testTrace.json b/packages/jaeger-ui/src/components/TracePage/TraceFlamegraph/testTrace.json new file mode 100644 index 0000000000..6f9e184438 --- /dev/null +++ b/packages/jaeger-ui/src/components/TracePage/TraceFlamegraph/testTrace.json @@ -0,0 +1,784 @@ +{ + "data": { + "services": [ + { + "name": "load-generator", + "numberOfSpans": 2 + }, + { + "name": "ride-sharing-app", + "numberOfSpans": 2 + } + ], + "spans": [ + { + "traceID": "84b3fad94c6112edd6af3347d06f6f1d", + "spanID": "487f03177ef9cf89", + "flags": 1, + "operationName": "OrderVehicle", + "references": [], + "startTime": 1660049722779884, + "duration": 1181596, + "tags": [ + { + "key": "internal.span.format", + "type": "string", + "value": "jaeger" + }, + { + "key": "otel.library.name", + "type": "string", + "value": "go.opentelemetry.io/otel/sdk/tracer" + }, + { + "key": "pyroscope.profile.baseline.url", + "type": "string", + "value": "http://localhost:4040/comparison?from=1660046122&leftFrom=1660046122&leftQuery=load-generator.cpu%7Bspan_name%3D%22OrderVehicle%22%7D&leftUntil=1660049723&query=load-generator.cpu%7Bspan_name%3D%22OrderVehicle%22%7D&rightFrom=1660046122&rightQuery=load-generator.cpu%7Bprofile_id%3D%22487f03177ef9cf89%22%7D&rightUntil=1660049723&until=1660049723" + }, + { + "key": "pyroscope.profile.diff.url", + "type": "string", + "value": "http://localhost:4040/comparison-diff?from=1660046122&leftFrom=1660046122&leftQuery=load-generator.cpu%7Bspan_name%3D%22OrderVehicle%22%7D&leftUntil=1660049723&query=load-generator.cpu%7Bspan_name%3D%22OrderVehicle%22%7D&rightFrom=1660046122&rightQuery=load-generator.cpu%7Bprofile_id%3D%22487f03177ef9cf89%22%7D&rightUntil=1660049723&until=1660049723" + }, + { + "key": "pyroscope.profile.id", + "type": "string", + "value": "487f03177ef9cf89" + }, + { + "key": "pyroscope.profile.url", + "type": "string", + "value": "http://localhost:4040/?from=1660049722779903100&query=load-generator.cpu%7Bprofile_id%3D%22487f03177ef9cf89%22%7D&until=1660049723961431700" + }, + { + "key": "vehicle", + "type": "string", + "value": "bike" + } + ], + "logs": [], + "processID": "p2", + "warnings": [], + "process": { + "serviceName": "load-generator", + "tags": [] + }, + "relativeStartTime": 0, + "depth": 0, + "hasChildren": true + }, + { + "traceID": "84b3fad94c6112edd6af3347d06f6f1d", + "spanID": "d81ccf159d71bc66", + "flags": 1, + "operationName": "HTTP GET", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "84b3fad94c6112edd6af3347d06f6f1d", + "spanID": "487f03177ef9cf89", + "span": { + "traceID": "84b3fad94c6112edd6af3347d06f6f1d", + "spanID": "487f03177ef9cf89", + "flags": 1, + "operationName": "OrderVehicle", + "references": [], + "startTime": 1660049722779884, + "duration": 1181596, + "tags": [ + { + "key": "internal.span.format", + "type": "string", + "value": "jaeger" + }, + { + "key": "otel.library.name", + "type": "string", + "value": "go.opentelemetry.io/otel/sdk/tracer" + }, + { + "key": "pyroscope.profile.baseline.url", + "type": "string", + "value": "http://localhost:4040/comparison?from=1660046122&leftFrom=1660046122&leftQuery=load-generator.cpu%7Bspan_name%3D%22OrderVehicle%22%7D&leftUntil=1660049723&query=load-generator.cpu%7Bspan_name%3D%22OrderVehicle%22%7D&rightFrom=1660046122&rightQuery=load-generator.cpu%7Bprofile_id%3D%22487f03177ef9cf89%22%7D&rightUntil=1660049723&until=1660049723" + }, + { + "key": "pyroscope.profile.diff.url", + "type": "string", + "value": "http://localhost:4040/comparison-diff?from=1660046122&leftFrom=1660046122&leftQuery=load-generator.cpu%7Bspan_name%3D%22OrderVehicle%22%7D&leftUntil=1660049723&query=load-generator.cpu%7Bspan_name%3D%22OrderVehicle%22%7D&rightFrom=1660046122&rightQuery=load-generator.cpu%7Bprofile_id%3D%22487f03177ef9cf89%22%7D&rightUntil=1660049723&until=1660049723" + }, + { + "key": "pyroscope.profile.id", + "type": "string", + "value": "487f03177ef9cf89" + }, + { + "key": "pyroscope.profile.url", + "type": "string", + "value": "http://localhost:4040/?from=1660049722779903100&query=load-generator.cpu%7Bprofile_id%3D%22487f03177ef9cf89%22%7D&until=1660049723961431700" + }, + { + "key": "vehicle", + "type": "string", + "value": "bike" + } + ], + "logs": [], + "processID": "p2", + "warnings": [], + "process": { + "serviceName": "load-generator", + "tags": [] + }, + "relativeStartTime": 0, + "depth": 0, + "hasChildren": true + } + } + ], + "startTime": 1660049722993018, + "duration": 968334, + "tags": [ + { + "key": "http.flavor", + "type": "string", + "value": "1.1" + }, + { + "key": "http.host", + "type": "string", + "value": "ap-south:5000" + }, + { + "key": "http.method", + "type": "string", + "value": "GET" + }, + { + "key": "http.scheme", + "type": "string", + "value": "http" + }, + { + "key": "http.status_code", + "type": "int64", + "value": 200 + }, + { + "key": "http.url", + "type": "string", + "value": "http://ap-south:5000/bike" + }, + { + "key": "internal.span.format", + "type": "string", + "value": "jaeger" + }, + { + "key": "otel.library.name", + "type": "string", + "value": "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" + }, + { + "key": "otel.library.version", + "type": "string", + "value": "semver:0.27.0" + }, + { + "key": "span.kind", + "type": "string", + "value": "client" + } + ], + "logs": [], + "processID": "p2", + "warnings": [], + "process": { + "serviceName": "load-generator", + "tags": [] + }, + "relativeStartTime": 213134, + "depth": 1, + "hasChildren": true + }, + { + "traceID": "84b3fad94c6112edd6af3347d06f6f1d", + "spanID": "3d4670fa91902216", + "flags": 1, + "operationName": "BikeHandler", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "84b3fad94c6112edd6af3347d06f6f1d", + "spanID": "d81ccf159d71bc66", + "span": { + "traceID": "84b3fad94c6112edd6af3347d06f6f1d", + "spanID": "d81ccf159d71bc66", + "flags": 1, + "operationName": "HTTP GET", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "84b3fad94c6112edd6af3347d06f6f1d", + "spanID": "487f03177ef9cf89", + "span": { + "traceID": "84b3fad94c6112edd6af3347d06f6f1d", + "spanID": "487f03177ef9cf89", + "flags": 1, + "operationName": "OrderVehicle", + "references": [], + "startTime": 1660049722779884, + "duration": 1181596, + "tags": [ + { + "key": "internal.span.format", + "type": "string", + "value": "jaeger" + }, + { + "key": "otel.library.name", + "type": "string", + "value": "go.opentelemetry.io/otel/sdk/tracer" + }, + { + "key": "pyroscope.profile.baseline.url", + "type": "string", + "value": "http://localhost:4040/comparison?from=1660046122&leftFrom=1660046122&leftQuery=load-generator.cpu%7Bspan_name%3D%22OrderVehicle%22%7D&leftUntil=1660049723&query=load-generator.cpu%7Bspan_name%3D%22OrderVehicle%22%7D&rightFrom=1660046122&rightQuery=load-generator.cpu%7Bprofile_id%3D%22487f03177ef9cf89%22%7D&rightUntil=1660049723&until=1660049723" + }, + { + "key": "pyroscope.profile.diff.url", + "type": "string", + "value": "http://localhost:4040/comparison-diff?from=1660046122&leftFrom=1660046122&leftQuery=load-generator.cpu%7Bspan_name%3D%22OrderVehicle%22%7D&leftUntil=1660049723&query=load-generator.cpu%7Bspan_name%3D%22OrderVehicle%22%7D&rightFrom=1660046122&rightQuery=load-generator.cpu%7Bprofile_id%3D%22487f03177ef9cf89%22%7D&rightUntil=1660049723&until=1660049723" + }, + { + "key": "pyroscope.profile.id", + "type": "string", + "value": "487f03177ef9cf89" + }, + { + "key": "pyroscope.profile.url", + "type": "string", + "value": "http://localhost:4040/?from=1660049722779903100&query=load-generator.cpu%7Bprofile_id%3D%22487f03177ef9cf89%22%7D&until=1660049723961431700" + }, + { + "key": "vehicle", + "type": "string", + "value": "bike" + } + ], + "logs": [], + "processID": "p2", + "warnings": [], + "process": { + "serviceName": "load-generator", + "tags": [] + }, + "relativeStartTime": 0, + "depth": 0, + "hasChildren": true + } + } + ], + "startTime": 1660049722993018, + "duration": 968334, + "tags": [ + { + "key": "http.flavor", + "type": "string", + "value": "1.1" + }, + { + "key": "http.host", + "type": "string", + "value": "ap-south:5000" + }, + { + "key": "http.method", + "type": "string", + "value": "GET" + }, + { + "key": "http.scheme", + "type": "string", + "value": "http" + }, + { + "key": "http.status_code", + "type": "int64", + "value": 200 + }, + { + "key": "http.url", + "type": "string", + "value": "http://ap-south:5000/bike" + }, + { + "key": "internal.span.format", + "type": "string", + "value": "jaeger" + }, + { + "key": "otel.library.name", + "type": "string", + "value": "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" + }, + { + "key": "otel.library.version", + "type": "string", + "value": "semver:0.27.0" + }, + { + "key": "span.kind", + "type": "string", + "value": "client" + } + ], + "logs": [], + "processID": "p2", + "warnings": [], + "process": { + "serviceName": "load-generator", + "tags": [] + }, + "relativeStartTime": 213134, + "depth": 1, + "hasChildren": true + } + } + ], + "startTime": 1660049722993895, + "duration": 967066, + "tags": [ + { + "key": "http.flavor", + "type": "string", + "value": "1.1" + }, + { + "key": "http.host", + "type": "string", + "value": "ap-south:5000" + }, + { + "key": "http.method", + "type": "string", + "value": "GET" + }, + { + "key": "http.scheme", + "type": "string", + "value": "http" + }, + { + "key": "http.server_name", + "type": "string", + "value": "BikeHandler" + }, + { + "key": "http.target", + "type": "string", + "value": "/bike" + }, + { + "key": "http.user_agent", + "type": "string", + "value": "Go-http-client/1.1" + }, + { + "key": "internal.span.format", + "type": "string", + "value": "jaeger" + }, + { + "key": "net.host.name", + "type": "string", + "value": "ap-south" + }, + { + "key": "net.host.port", + "type": "int64", + "value": 5000 + }, + { + "key": "net.peer.ip", + "type": "string", + "value": "172.18.0.11" + }, + { + "key": "net.peer.port", + "type": "int64", + "value": 55132 + }, + { + "key": "net.transport", + "type": "string", + "value": "ip_tcp" + }, + { + "key": "otel.library.name", + "type": "string", + "value": "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" + }, + { + "key": "otel.library.version", + "type": "string", + "value": "semver:0.27.0" + }, + { + "key": "pyroscope.profile.baseline.url", + "type": "string", + "value": "http://localhost:4040/comparison?from=1660046122&leftFrom=1660046122&leftQuery=ride-sharing-app.cpu%7Bspan_name%3D%22BikeHandler%22%2Cregion%3D%22ap-south%22%7D&leftUntil=1660049723&query=ride-sharing-app.cpu%7Bspan_name%3D%22BikeHandler%22%2Cregion%3D%22ap-south%22%7D&rightFrom=1660046122&rightQuery=ride-sharing-app.cpu%7Bprofile_id%3D%223d4670fa91902216%22%7D&rightUntil=1660049723&until=1660049723" + }, + { + "key": "pyroscope.profile.diff.url", + "type": "string", + "value": "http://localhost:4040/comparison-diff?from=1660046122&leftFrom=1660046122&leftQuery=ride-sharing-app.cpu%7Bspan_name%3D%22BikeHandler%22%2Cregion%3D%22ap-south%22%7D&leftUntil=1660049723&query=ride-sharing-app.cpu%7Bspan_name%3D%22BikeHandler%22%2Cregion%3D%22ap-south%22%7D&rightFrom=1660046122&rightQuery=ride-sharing-app.cpu%7Bprofile_id%3D%223d4670fa91902216%22%7D&rightUntil=1660049723&until=1660049723" + }, + { + "key": "pyroscope.profile.id", + "type": "string", + "value": "3d4670fa91902216" + }, + { + "key": "pyroscope.profile.url", + "type": "string", + "value": "http://localhost:4040/?from=1660049722993922900&query=ride-sharing-app.cpu%7Bprofile_id%3D%223d4670fa91902216%22%7D&until=1660049723960563300" + }, + { + "key": "span.kind", + "type": "string", + "value": "server" + } + ], + "logs": [], + "processID": "p1", + "warnings": [], + "process": { + "serviceName": "ride-sharing-app", + "tags": [] + }, + "relativeStartTime": 214011, + "depth": 2, + "hasChildren": true + }, + { + "traceID": "84b3fad94c6112edd6af3347d06f6f1d", + "spanID": "7bc101ef51dbc40c", + "flags": 1, + "operationName": "FindNearestVehicle", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "84b3fad94c6112edd6af3347d06f6f1d", + "spanID": "3d4670fa91902216", + "span": { + "traceID": "84b3fad94c6112edd6af3347d06f6f1d", + "spanID": "3d4670fa91902216", + "flags": 1, + "operationName": "BikeHandler", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "84b3fad94c6112edd6af3347d06f6f1d", + "spanID": "d81ccf159d71bc66", + "span": { + "traceID": "84b3fad94c6112edd6af3347d06f6f1d", + "spanID": "d81ccf159d71bc66", + "flags": 1, + "operationName": "HTTP GET", + "references": [ + { + "refType": "CHILD_OF", + "traceID": "84b3fad94c6112edd6af3347d06f6f1d", + "spanID": "487f03177ef9cf89", + "span": { + "traceID": "84b3fad94c6112edd6af3347d06f6f1d", + "spanID": "487f03177ef9cf89", + "flags": 1, + "operationName": "OrderVehicle", + "references": [], + "startTime": 1660049722779884, + "duration": 1181596, + "tags": [ + { + "key": "internal.span.format", + "type": "string", + "value": "jaeger" + }, + { + "key": "otel.library.name", + "type": "string", + "value": "go.opentelemetry.io/otel/sdk/tracer" + }, + { + "key": "pyroscope.profile.baseline.url", + "type": "string", + "value": "http://localhost:4040/comparison?from=1660046122&leftFrom=1660046122&leftQuery=load-generator.cpu%7Bspan_name%3D%22OrderVehicle%22%7D&leftUntil=1660049723&query=load-generator.cpu%7Bspan_name%3D%22OrderVehicle%22%7D&rightFrom=1660046122&rightQuery=load-generator.cpu%7Bprofile_id%3D%22487f03177ef9cf89%22%7D&rightUntil=1660049723&until=1660049723" + }, + { + "key": "pyroscope.profile.diff.url", + "type": "string", + "value": "http://localhost:4040/comparison-diff?from=1660046122&leftFrom=1660046122&leftQuery=load-generator.cpu%7Bspan_name%3D%22OrderVehicle%22%7D&leftUntil=1660049723&query=load-generator.cpu%7Bspan_name%3D%22OrderVehicle%22%7D&rightFrom=1660046122&rightQuery=load-generator.cpu%7Bprofile_id%3D%22487f03177ef9cf89%22%7D&rightUntil=1660049723&until=1660049723" + }, + { + "key": "pyroscope.profile.id", + "type": "string", + "value": "487f03177ef9cf89" + }, + { + "key": "pyroscope.profile.url", + "type": "string", + "value": "http://localhost:4040/?from=1660049722779903100&query=load-generator.cpu%7Bprofile_id%3D%22487f03177ef9cf89%22%7D&until=1660049723961431700" + }, + { + "key": "vehicle", + "type": "string", + "value": "bike" + } + ], + "logs": [], + "processID": "p2", + "warnings": [], + "process": { + "serviceName": "load-generator", + "tags": [] + }, + "relativeStartTime": 0, + "depth": 0, + "hasChildren": true + } + } + ], + "startTime": 1660049722993018, + "duration": 968334, + "tags": [ + { + "key": "http.flavor", + "type": "string", + "value": "1.1" + }, + { + "key": "http.host", + "type": "string", + "value": "ap-south:5000" + }, + { + "key": "http.method", + "type": "string", + "value": "GET" + }, + { + "key": "http.scheme", + "type": "string", + "value": "http" + }, + { + "key": "http.status_code", + "type": "int64", + "value": 200 + }, + { + "key": "http.url", + "type": "string", + "value": "http://ap-south:5000/bike" + }, + { + "key": "internal.span.format", + "type": "string", + "value": "jaeger" + }, + { + "key": "otel.library.name", + "type": "string", + "value": "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" + }, + { + "key": "otel.library.version", + "type": "string", + "value": "semver:0.27.0" + }, + { + "key": "span.kind", + "type": "string", + "value": "client" + } + ], + "logs": [], + "processID": "p2", + "warnings": [], + "process": { + "serviceName": "load-generator", + "tags": [] + }, + "relativeStartTime": 213134, + "depth": 1, + "hasChildren": true + } + } + ], + "startTime": 1660049722993895, + "duration": 967066, + "tags": [ + { + "key": "http.flavor", + "type": "string", + "value": "1.1" + }, + { + "key": "http.host", + "type": "string", + "value": "ap-south:5000" + }, + { + "key": "http.method", + "type": "string", + "value": "GET" + }, + { + "key": "http.scheme", + "type": "string", + "value": "http" + }, + { + "key": "http.server_name", + "type": "string", + "value": "BikeHandler" + }, + { + "key": "http.target", + "type": "string", + "value": "/bike" + }, + { + "key": "http.user_agent", + "type": "string", + "value": "Go-http-client/1.1" + }, + { + "key": "internal.span.format", + "type": "string", + "value": "jaeger" + }, + { + "key": "net.host.name", + "type": "string", + "value": "ap-south" + }, + { + "key": "net.host.port", + "type": "int64", + "value": 5000 + }, + { + "key": "net.peer.ip", + "type": "string", + "value": "172.18.0.11" + }, + { + "key": "net.peer.port", + "type": "int64", + "value": 55132 + }, + { + "key": "net.transport", + "type": "string", + "value": "ip_tcp" + }, + { + "key": "otel.library.name", + "type": "string", + "value": "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" + }, + { + "key": "otel.library.version", + "type": "string", + "value": "semver:0.27.0" + }, + { + "key": "pyroscope.profile.baseline.url", + "type": "string", + "value": "http://localhost:4040/comparison?from=1660046122&leftFrom=1660046122&leftQuery=ride-sharing-app.cpu%7Bspan_name%3D%22BikeHandler%22%2Cregion%3D%22ap-south%22%7D&leftUntil=1660049723&query=ride-sharing-app.cpu%7Bspan_name%3D%22BikeHandler%22%2Cregion%3D%22ap-south%22%7D&rightFrom=1660046122&rightQuery=ride-sharing-app.cpu%7Bprofile_id%3D%223d4670fa91902216%22%7D&rightUntil=1660049723&until=1660049723" + }, + { + "key": "pyroscope.profile.diff.url", + "type": "string", + "value": "http://localhost:4040/comparison-diff?from=1660046122&leftFrom=1660046122&leftQuery=ride-sharing-app.cpu%7Bspan_name%3D%22BikeHandler%22%2Cregion%3D%22ap-south%22%7D&leftUntil=1660049723&query=ride-sharing-app.cpu%7Bspan_name%3D%22BikeHandler%22%2Cregion%3D%22ap-south%22%7D&rightFrom=1660046122&rightQuery=ride-sharing-app.cpu%7Bprofile_id%3D%223d4670fa91902216%22%7D&rightUntil=1660049723&until=1660049723" + }, + { + "key": "pyroscope.profile.id", + "type": "string", + "value": "3d4670fa91902216" + }, + { + "key": "pyroscope.profile.url", + "type": "string", + "value": "http://localhost:4040/?from=1660049722993922900&query=ride-sharing-app.cpu%7Bprofile_id%3D%223d4670fa91902216%22%7D&until=1660049723960563300" + }, + { + "key": "span.kind", + "type": "string", + "value": "server" + } + ], + "logs": [], + "processID": "p1", + "warnings": [], + "process": { + "serviceName": "ride-sharing-app", + "tags": [] + }, + "relativeStartTime": 214011, + "depth": 2, + "hasChildren": true + } + } + ], + "startTime": 1660049722994061, + "duration": 966333, + "tags": [ + { + "key": "internal.span.format", + "type": "string", + "value": "jaeger" + }, + { + "key": "otel.library.name", + "type": "string", + "value": "go.opentelemetry.io/otel/sdk/tracer" + }, + { + "key": "vehicle", + "type": "string", + "value": "bike" + } + ], + "logs": [], + "processID": "p1", + "warnings": [], + "process": { + "serviceName": "ride-sharing-app", + "tags": [] + }, + "relativeStartTime": 214177, + "depth": 3, + "hasChildren": false + } + ], + "traceID": "84b3fad94c6112edd6af3347d06f6f1d", + "traceName": "load-generator: OrderVehicle", + "processes": { + "p1": { + "serviceName": "ride-sharing-app", + "tags": [] + }, + "p2": { + "serviceName": "load-generator", + "tags": [] + } + }, + "duration": 1181596, + "startTime": 1660049722779884, + "endTime": 1660049723961480 + }, + "id": "84b3fad94c6112edd6af3347d06f6f1d", + "state": "FETCH_DONE" +} diff --git a/yarn.lock b/yarn.lock index 142539f670..2589177b5b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1517,10 +1517,10 @@ universal-user-agent "^2.0.0" url-template "^2.0.8" -"@pyroscope/flamegraph@0.17.2": - version "0.17.2" - resolved "https://registry.yarnpkg.com/@pyroscope/flamegraph/-/flamegraph-0.17.2.tgz#b8d95e9d8de9526fa79339690869e8c2c1c5e75e" - integrity sha512-dS4yvX9n61f7SqXhsZnkl7SM03d6DtXy1KRnlHbiLb1IwyiV9iHazQdkaTcQHOu90go2I2JkxCJlT+/O9kyz0A== +"@pyroscope/flamegraph@0.18.4-1379-557f0b4.0": + version "0.18.4-1379-557f0b4.0" + resolved "https://registry.yarnpkg.com/@pyroscope/flamegraph/-/flamegraph-0.18.4-1379-557f0b4.0.tgz#146078de39a57487bf8d585efb044dbd82ae9656" + integrity sha512-G6EfVBj0F3fhBw3UMtXzLPboV5K3HkLBzLUb5ZaOeJAw2X25sCbiEzBUJNNxUDygYMlkZMNZbleBjKQbXYGU0g== "@sinonjs/commons@^1", "@sinonjs/commons@^1.0.2", "@sinonjs/commons@^1.4.0": version "1.4.0"