SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.
TypeScript apmapplication-monitoringdistributed-tracinggogood-first-issuejaegerloglogsmetricsmonitoringnextjsobservabilityopen-sourceopentelemetryprometheusreactreactjsself-hostedtracingtypescript
links end points to traces
dhrubesha59e33d241f2
diff --git a/frontend/src/constants/query.ts b/frontend/src/constants/query.tsindex 1f9e72626d..c37213981a 100644--- a/frontend/src/constants/query.ts+++ b/frontend/src/constants/query.ts@@ -3,4 +3,5 @@ export enum METRICS_PAGE_QUERY_PARAM {startTime = "startTime",endTime = "endTime",service = "service",+ operation = "operation",}diff --git a/frontend/src/modules/Metrics/TopEndpointsTable.tsx b/frontend/src/modules/Metrics/TopEndpointsTable.tsxindex c8e205772b..b4584981cd 100644--- a/frontend/src/modules/Metrics/TopEndpointsTable.tsx+++ b/frontend/src/modules/Metrics/TopEndpointsTable.tsx@@ -1,8 +1,12 @@import React from "react";-import { NavLink } from "react-router-dom";-import { Table } from "antd";+import { Table, Button } from "antd";+import { connect } from "react-redux";import styled from "styled-components";+import { useHistory, useParams } from "react-router-dom";import { topEndpointListItem } from "../../store/actions/metrics";+import { METRICS_PAGE_QUERY_PARAM } from "Src/constants/query";+import { GlobalTime } from "Src/store/actions";+import { StoreState } from "Src/store/reducers";const Wrapper = styled.div`padding-top: 10px;@@ -22,16 +26,42 @@ const Wrapper = styled.div`interface TopEndpointsTableProps {data: topEndpointListItem[];+ globalTime: GlobalTime;}-const TopEndpointsTable = (props: TopEndpointsTableProps) => {+const _TopEndpointsTable = (props: TopEndpointsTableProps) => {+ const history = useHistory();+ const params = useParams<{ servicename: string }>();+ const handleOnClick = (operation: string) => {+ const urlParams = new URLSearchParams();+ const { servicename } = params;+ const { maxTime, minTime } = props.globalTime;+ urlParams.set(+ METRICS_PAGE_QUERY_PARAM.startTime,+ String(Number(minTime) / 1000000),+ );+ urlParams.set(+ METRICS_PAGE_QUERY_PARAM.endTime,+ String(Number(maxTime) / 1000000),+ );+ if (servicename) {+ urlParams.set(METRICS_PAGE_QUERY_PARAM.service, servicename);+ }+ urlParams.set(METRICS_PAGE_QUERY_PARAM.operation, operation);+ history.push(`/traces?${urlParams.toString()}`);+ };+const columns: any = [{title: "Name",dataIndex: "name",key: "name",- render: (text: string) => <NavLink to={"/" + text}>{text}</NavLink>,+ render: (text: string) => (+ <Button type="link" onClick={() => handleOnClick(text)}>+ {text}+ </Button>+ ),},{title: "P50 (in ms)",@@ -73,4 +103,17 @@ const TopEndpointsTable = (props: TopEndpointsTableProps) => {);};+const mapStateToProps = (+ state: StoreState,+): {+ globalTime: GlobalTime;+} => {+ return { globalTime: state.globalTime };+};++export const TopEndpointsTable = connect(+ mapStateToProps,+ null,+)(_TopEndpointsTable);+export default TopEndpointsTable;diff --git a/frontend/src/modules/Traces/TraceFilter.tsx b/frontend/src/modules/Traces/TraceFilter.tsxindex a1c40fdbb8..52b091cbee 100644--- a/frontend/src/modules/Traces/TraceFilter.tsx+++ b/frontend/src/modules/Traces/TraceFilter.tsx@@ -62,9 +62,22 @@ const _TraceFilter = (props: TraceFilterProps) => {setServiceList(response.data);}).then(() => {+ const operationName = urlParams.get(METRICS_PAGE_QUERY_PARAM.operation);const serviceName = urlParams.get(METRICS_PAGE_QUERY_PARAM.service);- if (serviceName) {- handleChangeService(serviceName);+ if (operationName && serviceName) {+ props.updateTraceFilters({+ ...props.traceFilters,+ operation: operationName,+ service: serviceName,+ });+ populateData(serviceName);+ } else {+ if (operationName) {+ handleChangeOperation(operationName);+ }+ if (serviceName) {+ handleChangeService(serviceName);+ }}});}, []);@@ -144,15 +157,11 @@ const _TraceFilter = (props: TraceFilterProps) => {const [form_basefilter] = Form.useForm();- function handleChange(value: string) {- console.log(value);- }-function handleChangeOperation(value: string) {props.updateTraceFilters({ ...props.traceFilters, operation: value });}- function handleChangeService(value: string) {+ function populateData(value: string) {let service_request = "/service/" + value + "/operations";api.get<string[]>(apiV1 + service_request).then((response) => {// form_basefilter.resetFields(['operation',])@@ -165,7 +174,9 @@ const _TraceFilter = (props: TraceFilterProps) => {.then((response) => {setTagKeyOptions(response.data);});-+ }+ function handleChangeService(value: string) {+ populateData(value);props.updateTraceFilters({ ...props.traceFilters, service: value });}