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
feat: service map color is updated according to the darkMode (#1324)
Palash6dbc11991bb2
diff --git a/frontend/src/modules/Servicemap/ServiceMap.tsx b/frontend/src/modules/Servicemap/ServiceMap.tsxindex ffbe2929ea..03256dde59 100644--- a/frontend/src/modules/Servicemap/ServiceMap.tsx+++ b/frontend/src/modules/Servicemap/ServiceMap.tsx@@ -92,7 +92,7 @@ function ServiceMap(props: ServiceMapProps): JSX.Element {fgRef && fgRef.current && fgRef.current.zoomToFit(100, 120);};- const { nodes, links } = getGraphData(serviceMap);+ const { nodes, links } = getGraphData(serviceMap, isDarkMode);const graphData = { nodes, links };return (<Container>@@ -109,7 +109,7 @@ function ServiceMap(props: ServiceMapProps): JSX.Element {linkAutoColorBy={(d) => d.target}linkDirectionalParticles="value"linkDirectionalParticleSpeed={(d) => d.value}- nodeCanvasObject={(node, ctx, globalScale) => {+ nodeCanvasObject={(node, ctx) => {const label = transformLabel(node.id);const { fontSize } = node;ctx.font = `${fontSize}px Roboto`;@@ -118,7 +118,6 @@ function ServiceMap(props: ServiceMapProps): JSX.Element {ctx.fillStyle = node.color;ctx.beginPath();ctx.arc(node.x, node.y, width, 0, 2 * Math.PI, false);- ctx.fillStyle = isDarkMode ? '#3C8618' : '#D5F2BB';ctx.fill();ctx.textAlign = 'center';ctx.textBaseline = 'middle';diff --git a/frontend/src/modules/Servicemap/utils.ts b/frontend/src/modules/Servicemap/utils.tsindex 21b93952a8..6bec25f8a6 100644--- a/frontend/src/modules/Servicemap/utils.ts+++ b/frontend/src/modules/Servicemap/utils.ts@@ -2,7 +2,6 @@//@ts-nocheckimport { cloneDeep, find, maxBy, uniq, uniqBy } from 'lodash-es';-import { graphDataType } from './ServiceMap';const MIN_WIDTH = 10;@@ -18,7 +17,7 @@ export const getDimensions = (num, highest) => {};};-export const getGraphData = (serviceMap): graphDataType => {+export const getGraphData = (serviceMap, isDarkMode): graphDataType => {const { items, services } = serviceMap;const highestCallCount = maxBy(items, (e) => e?.callCount)?.callCount;const highestCallRate = maxBy(services, (e) => e?.callRate)?.callRate;@@ -39,7 +38,7 @@ export const getGraphData = (serviceMap): graphDataType => {const uniqNodes = uniq([...uniqParent, ...uniqChild]);const nodes = uniqNodes.map((node, i) => {const service = find(services, (service) => service.serviceName === node);- let color = '#88CEA5';+ let color = isDarkMode ? '#7CA568' : '#D5F2BB';if (!service) {return {id: node,@@ -54,9 +53,9 @@ export const getGraphData = (serviceMap): graphDataType => {};}if (service.errorRate > 0) {- color = '#F98989';+ color = isDarkMode ? '#DB836E' : '#F98989';} else if (service.fourXXRate > 0) {- color = '#F9DA7B';+ color = isDarkMode ? '#C79931' : '#F9DA7B';}const { fontSize, width } = getDimensions(service.callRate, highestCallRate);return {