Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(trace-detail): new trace details module #6708

Closed
wants to merge 72 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
6e1371b
feat: enable waterfall tree construction at query service
vikrantgupta25 Dec 24, 2024
6f33842
feat: frontend base setup and api integration for trace v2
vikrantgupta25 Dec 24, 2024
5da2b39
feat: structure the code in sync with api lifecycle
vikrantgupta25 Dec 26, 2024
ef97148
feat: setup the success state for the spans waterfall model
vikrantgupta25 Dec 26, 2024
8d16ec3
feat: handle the scroll to top and bottom
vikrantgupta25 Dec 26, 2024
d7e6b41
feat: add caching for tree at query service
vikrantgupta25 Dec 26, 2024
e9f5e77
feat: added code comments and TODO
vikrantgupta25 Dec 26, 2024
f9c8850
feat: use range changed to handle loads better
vikrantgupta25 Dec 26, 2024
a451044
feat: temporary changes for inmemory cache
vikrantgupta25 Dec 27, 2024
0087272
feat: base branch for trace details
vikrantgupta25 Dec 27, 2024
44c1f54
Merge branch 'main' into new-trace-detail
vikrantgupta25 Dec 27, 2024
5370b80
Merge branch 'new-trace-detail' into query-service-waterfall
vikrantgupta25 Dec 27, 2024
04a0c75
feat: handle the uncollapsed node and span search better
vikrantgupta25 Dec 28, 2024
efa9b5a
Merge branch 'main' into query-service-waterfall
vikrantgupta25 Jan 4, 2025
a0eefda
feat(trace-details): integrate the new cache for trace details
vikrantgupta25 Jan 4, 2025
cea9010
Merge branch 'main' into query-service-waterfall
vikrantgupta25 Jan 6, 2025
74eb637
feat(waterfall): start building the waterfall UI
vikrantgupta25 Jan 6, 2025
457f959
feat(waterfall): some minor UI enhancements
vikrantgupta25 Jan 6, 2025
25404e8
Merge branch 'main' into query-service-waterfall
vikrantgupta25 Jan 7, 2025
e3ff469
feat(waterfall): timeline UI changes for header and cells
vikrantgupta25 Jan 7, 2025
81a0ef6
feat(waterfall): intersection observer changes
vikrantgupta25 Jan 7, 2025
61b3b45
Merge branch 'main' into query-service-waterfall
vikrantgupta25 Jan 7, 2025
11ea662
Merge branch 'main' into query-service-waterfall
vikrantgupta25 Jan 8, 2025
e1750a1
feat(waterfall): fix build issues
vikrantgupta25 Jan 8, 2025
0fb9f53
feat(waterfall): make the react-table virtualised
vikrantgupta25 Jan 8, 2025
e5ab984
feat(waterfall): virtualise the trace waterfall and add scrollToIndeX…
vikrantgupta25 Jan 8, 2025
af4b8a8
feat(waterfall): handle the interested span and uncollapsed nodes better
vikrantgupta25 Jan 8, 2025
b78dcc2
feat(waterfall): merge branch 'main' into query-service-waterfall
vikrantgupta25 Jan 8, 2025
0cb710e
feat(waterfall): handle infinite scroll
vikrantgupta25 Jan 8, 2025
2025365
feat(waterfall): some more processing to handle waterfall collapse nodes
vikrantgupta25 Jan 8, 2025
212d686
Merge branch 'main' into query-service-waterfall
vikrantgupta25 Jan 8, 2025
180996a
feat(waterfall): some css fixes
vikrantgupta25 Jan 8, 2025
025b02d
feat(waterfall): implement sticky headers and col resize
vikrantgupta25 Jan 9, 2025
837170d
feat(flamegraph): new trace details flamegraph (#6789)
vikrantgupta25 Jan 14, 2025
8bc1823
Merge branch 'main' into query-service-waterfall
vikrantgupta25 Jan 14, 2025
d758cc2
feat(trace-detail): query service waterfall API cleanup
vikrantgupta25 Jan 14, 2025
5684e11
feat(trace-detail): query service flamegraph API cleanup
vikrantgupta25 Jan 14, 2025
aaf41f4
feat(flamegraph): color the flamegraph based on the service name
vikrantgupta25 Jan 14, 2025
9d623bc
feat(trace-detail): remove extra comma
vikrantgupta25 Jan 14, 2025
84ca704
feat(trace-detail): frontend changes for exec times
vikrantgupta25 Jan 14, 2025
7427fd3
feat(trace-detail): added the generic detail drawer and span info
vikrantgupta25 Jan 14, 2025
4276918
feat(trace-detail): added attribute table for span details
vikrantgupta25 Jan 14, 2025
038cf3b
feat(trace-detail): added attribute table for span details
vikrantgupta25 Jan 14, 2025
04082d8
Merge branch 'main' into query-service-waterfall
vikrantgupta25 Jan 15, 2025
2669b6e
feat(trace-detail): add events table
vikrantgupta25 Jan 15, 2025
709cbb0
Merge branch 'main' into query-service-waterfall
vikrantgupta25 Jan 15, 2025
ef21834
feat(trace-detail): fixed the UI for progress indicators
vikrantgupta25 Jan 15, 2025
b64edc2
feat(trace-detail): handle the infinte loading and selectedSpanID for…
vikrantgupta25 Jan 16, 2025
fe27921
feat(trace-waterfall): use OTEL SpanRefs instead of parent span id
vikrantgupta25 Jan 16, 2025
dee22a7
feat(trace-detail): some minor UI fixes
vikrantgupta25 Jan 16, 2025
d9dd81f
feat(trace-detail): added flux interval for caching
vikrantgupta25 Jan 16, 2025
da676b7
feat(trace-detail): merge branch 'main' into query-service-waterfall
vikrantgupta25 Jan 20, 2025
670387f
fix(trace-detail): remove bad code due to bad rebase
vikrantgupta25 Jan 20, 2025
8b70822
feat(trace-detail): handle missing span functionality
vikrantgupta25 Jan 21, 2025
abfc6c2
feat(trace-detail): handle missing span banner UI
vikrantgupta25 Jan 21, 2025
1af27a3
feat(trace-detail): handle missing span banner UI
vikrantgupta25 Jan 21, 2025
dc5e59c
Merge branch 'main' into query-service-waterfall
vikrantgupta25 Jan 21, 2025
c89a9ca
fix(trace-detail): improve some cache and UI
vikrantgupta25 Jan 21, 2025
e4e6353
fix(trace-detail): json payload size fix
vikrantgupta25 Jan 21, 2025
497ef1e
Merge branch 'main' into query-service-waterfall
vikrantgupta25 Jan 21, 2025
a642f60
feat(trace-detail): polish the UI for trace detail
vikrantgupta25 Jan 22, 2025
b29803e
feat(trace-detail): polish the UI for trace detail
vikrantgupta25 Jan 22, 2025
6114a60
feat(trace-detail): added support for go to related logs
vikrantgupta25 Jan 22, 2025
c22196c
feat(trace0-detail): handle old and new trace detail routing
vikrantgupta25 Jan 22, 2025
128623e
feat(trace0-detail): handle old and new trace detail routing
vikrantgupta25 Jan 22, 2025
cc49c39
feat(trace-detail): merge main
vikrantgupta25 Jan 22, 2025
7b5d663
feat(trace-detail): address a couple of UX and query service issues
vikrantgupta25 Jan 22, 2025
5e26c66
feat(trace-detail): address a couple of UX and query service issues
vikrantgupta25 Jan 22, 2025
677f68e
feat(trace-detail): handle light mode designs
vikrantgupta25 Jan 22, 2025
a9de22f
feat(trace-detail): some more UI polishing
vikrantgupta25 Jan 22, 2025
3336876
feat(trace-detail): some more UI polishing
vikrantgupta25 Jan 22, 2025
2d99c29
feat(trace-detail): merge branch 'main' into query-service-waterfall
vikrantgupta25 Jan 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion ee/query-service/app/db/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/jmoiron/sqlx"

cacheV2 "go.signoz.io/signoz/pkg/cache"
basechr "go.signoz.io/signoz/pkg/query-service/app/clickhouseReader"
"go.signoz.io/signoz/pkg/query-service/interfaces"
)
Expand All @@ -17,6 +18,7 @@ type ClickhouseReader struct {
*basechr.ClickHouseReader
}

// dummy
func NewDataConnector(
localDB *sqlx.DB,
promConfigPath string,
Expand All @@ -27,8 +29,10 @@ func NewDataConnector(
cluster string,
useLogsNewSchema bool,
useTraceNewSchema bool,
fluxIntervalForTraceDetail time.Duration,
cacheV2 cacheV2.Cache,
) *ClickhouseReader {
ch := basechr.NewReader(localDB, promConfigPath, lm, maxIdleConns, maxOpenConns, dialTimeout, cluster, useLogsNewSchema, useTraceNewSchema)
ch := basechr.NewReader(localDB, promConfigPath, lm, maxIdleConns, maxOpenConns, dialTimeout, cluster, useLogsNewSchema, useTraceNewSchema, fluxIntervalForTraceDetail, cacheV2)
return &ClickhouseReader{
conn: ch.GetConn(),
appdb: localDB,
Expand Down
60 changes: 34 additions & 26 deletions ee/query-service/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,19 @@ type ServerOptions struct {
HTTPHostPort string
PrivateHostPort string
// alert specific params
DisableRules bool
RuleRepoURL string
PreferSpanMetrics bool
MaxIdleConns int
MaxOpenConns int
DialTimeout time.Duration
CacheConfigPath string
FluxInterval string
Cluster string
GatewayUrl string
UseLogsNewSchema bool
UseTraceNewSchema bool
DisableRules bool
RuleRepoURL string
PreferSpanMetrics bool
MaxIdleConns int
MaxOpenConns int
DialTimeout time.Duration
CacheConfigPath string
FluxInterval string
FluxIntervalForTraceDetail string
Cluster string
GatewayUrl string
UseLogsNewSchema bool
UseTraceNewSchema bool
}

// Server runs HTTP api service
Expand Down Expand Up @@ -141,10 +142,29 @@ func NewServer(serverOptions *ServerOptions) (*Server, error) {
return nil, err
}

var c cache.Cache
if serverOptions.CacheConfigPath != "" {
cacheOpts, err := cache.LoadFromYAMLCacheConfigFile(serverOptions.CacheConfigPath)
if err != nil {
return nil, err
}
c = cache.NewCache(cacheOpts)
}

// set license manager as feature flag provider in dao
modelDao.SetFlagProvider(lm)
readerReady := make(chan bool)

fluxInterval, err := time.ParseDuration(serverOptions.FluxInterval)
if err != nil {
return nil, err
}

fluxIntervalForTraceDetail, err := time.ParseDuration(serverOptions.FluxIntervalForTraceDetail)
if err != nil {
return nil, err
}

var reader interfaces.DataConnector
storage := os.Getenv("STORAGE")
if storage == "clickhouse" {
Expand All @@ -159,6 +179,8 @@ func NewServer(serverOptions *ServerOptions) (*Server, error) {
serverOptions.Cluster,
serverOptions.UseLogsNewSchema,
serverOptions.UseTraceNewSchema,
fluxIntervalForTraceDetail,
serverOptions.SigNoz.Cache,
)
go qb.Start(readerReady)
reader = qb
Expand All @@ -173,14 +195,6 @@ func NewServer(serverOptions *ServerOptions) (*Server, error) {
return nil, err
}
}
var c cache.Cache
if serverOptions.CacheConfigPath != "" {
cacheOpts, err := cache.LoadFromYAMLCacheConfigFile(serverOptions.CacheConfigPath)
if err != nil {
return nil, err
}
c = cache.NewCache(cacheOpts)
}

<-readerReady
rm, err := makeRulesManager(serverOptions.PromConfigPath,
Expand Down Expand Up @@ -249,12 +263,6 @@ func NewServer(serverOptions *ServerOptions) (*Server, error) {
telemetry.GetInstance().SetReader(reader)
telemetry.GetInstance().SetSaasOperator(constants.SaasSegmentKey)

fluxInterval, err := time.ParseDuration(serverOptions.FluxInterval)

if err != nil {
return nil, err
}

apiOpts := api.APIHandlerOptions{
DataConnector: reader,
SkipConfig: skipConfig,
Expand Down
42 changes: 22 additions & 20 deletions ee/query-service/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func main() {

var useLogsNewSchema bool
var useTraceNewSchema bool
var cacheConfigPath, fluxInterval string
var cacheConfigPath, fluxInterval, fluxIntervalForTraceDetail string
var enableQueryServiceLogOTLPExport bool
var preferSpanMetrics bool

Expand All @@ -120,7 +120,8 @@ func main() {
flag.DurationVar(&dialTimeout, "dial-timeout", 5*time.Second, "(the maximum time to establish a connection.)")
flag.StringVar(&ruleRepoURL, "rules.repo-url", baseconst.AlertHelpPage, "(host address used to build rule link in alert messages)")
flag.StringVar(&cacheConfigPath, "experimental.cache-config", "", "(cache config to use)")
flag.StringVar(&fluxInterval, "flux-interval", "5m", "(the interval to exclude data from being cached to avoid incorrect cache for data in motion)")
flag.StringVar(&fluxInterval, "flux-interval", "0m", "(the interval to exclude data from being cached to avoid incorrect cache for data in motion)")
flag.StringVar(&fluxIntervalForTraceDetail, "flux-interval-trace-detail", "2m", "(the interval to exclude data from being cached to avoid incorrect cache for trace data in motion)")
flag.BoolVar(&enableQueryServiceLogOTLPExport, "enable.query.service.log.otlp.export", false, "(enable query service log otlp export)")
flag.StringVar(&cluster, "cluster", "cluster", "(cluster name - defaults to 'cluster')")
flag.StringVar(&gatewayUrl, "gateway-url", "", "(url to the gateway)")
Expand Down Expand Up @@ -151,24 +152,25 @@ func main() {
}

serverOptions := &app.ServerOptions{
Config: config,
SigNoz: signoz,
HTTPHostPort: baseconst.HTTPHostPort,
PromConfigPath: promConfigPath,
SkipTopLvlOpsPath: skipTopLvlOpsPath,
PreferSpanMetrics: preferSpanMetrics,
PrivateHostPort: baseconst.PrivateHostPort,
DisableRules: disableRules,
RuleRepoURL: ruleRepoURL,
MaxIdleConns: maxIdleConns,
MaxOpenConns: maxOpenConns,
DialTimeout: dialTimeout,
CacheConfigPath: cacheConfigPath,
FluxInterval: fluxInterval,
Cluster: cluster,
GatewayUrl: gatewayUrl,
UseLogsNewSchema: useLogsNewSchema,
UseTraceNewSchema: useTraceNewSchema,
Config: config,
SigNoz: signoz,
HTTPHostPort: baseconst.HTTPHostPort,
PromConfigPath: promConfigPath,
SkipTopLvlOpsPath: skipTopLvlOpsPath,
PreferSpanMetrics: preferSpanMetrics,
PrivateHostPort: baseconst.PrivateHostPort,
DisableRules: disableRules,
RuleRepoURL: ruleRepoURL,
MaxIdleConns: maxIdleConns,
MaxOpenConns: maxOpenConns,
DialTimeout: dialTimeout,
CacheConfigPath: cacheConfigPath,
FluxInterval: fluxInterval,
FluxIntervalForTraceDetail: fluxIntervalForTraceDetail,
Cluster: cluster,
GatewayUrl: gatewayUrl,
UseLogsNewSchema: useLogsNewSchema,
UseTraceNewSchema: useTraceNewSchema,
}

// Read the jwt secret key
Expand Down
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"@sentry/webpack-plugin": "2.22.6",
"@signozhq/design-tokens": "1.1.4",
"@tanstack/react-table": "8.20.6",
"@tanstack/react-virtual": "3.11.2",
"@uiw/react-md-editor": "3.23.5",
"@visx/group": "3.3.0",
"@visx/shape": "3.5.0",
Expand Down
22 changes: 22 additions & 0 deletions frontend/public/Icons/construction.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions frontend/public/Icons/no-data.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion frontend/src/AppRoutes/pageComponents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ export const TraceFilter = Loadable(
);

export const TraceDetail = Loadable(
() => import(/* webpackChunkName: "TraceDetail Page" */ 'pages/TraceDetail'),
() =>
import(
/* webpackChunkName: "TraceDetail Page" */ 'pages/TraceDetailV2/index'
),
);

export const UsageExplorerPage = Loadable(
Expand Down
33 changes: 33 additions & 0 deletions frontend/src/api/trace/getTraceFlamegraph.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { ApiV2Instance as axios } from 'api';
import { ErrorResponseHandler } from 'api/ErrorResponseHandler';
import { AxiosError } from 'axios';
import { omit } from 'lodash-es';
import { ErrorResponse, SuccessResponse } from 'types/api';
import {
GetTraceFlamegraphPayloadProps,
GetTraceFlamegraphSuccessResponse,
} from 'types/api/trace/getTraceFlamegraph';

const getTraceFlamegraph = async (
props: GetTraceFlamegraphPayloadProps,
): Promise<
SuccessResponse<GetTraceFlamegraphSuccessResponse> | ErrorResponse
> => {
try {
const response = await axios.post<GetTraceFlamegraphSuccessResponse>(
`/traces/flamegraph/${props.traceId}`,
omit(props, 'traceId'),
);

return {
statusCode: 200,
error: null,
message: 'Success',
payload: response.data,
};
} catch (error) {
return ErrorResponseHandler(error as AxiosError);
}
};

export default getTraceFlamegraph;
41 changes: 41 additions & 0 deletions frontend/src/api/trace/getTraceV2.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { ApiV2Instance as axios } from 'api';
import { ErrorResponseHandler } from 'api/ErrorResponseHandler';
import { AxiosError } from 'axios';
import { omit } from 'lodash-es';
import { ErrorResponse, SuccessResponse } from 'types/api';
import {
GetTraceV2PayloadProps,
GetTraceV2SuccessResponse,
} from 'types/api/trace/getTraceV2';

const getTraceV2 = async (
props: GetTraceV2PayloadProps,
): Promise<SuccessResponse<GetTraceV2SuccessResponse> | ErrorResponse> => {
try {
let uncollapsedSpans = [...props.uncollapsedSpans];
if (!props.isSelectedSpanIDUnCollapsed) {
uncollapsedSpans = uncollapsedSpans.filter(
(node) => node !== props.selectedSpanId,
);
}
const postData: GetTraceV2PayloadProps = {
...props,
uncollapsedSpans,
};
const response = await axios.post<GetTraceV2SuccessResponse>(
`/traces/${props.traceId}`,
omit(postData, 'traceId'),
);

return {
statusCode: 200,
error: null,
message: 'Success',
payload: response.data,
};
} catch (error) {
return ErrorResponseHandler(error as AxiosError);
}
};

export default getTraceV2;
Loading
Loading