Skip to content

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.

fix: getActiveKey is refactoring into switch

Palash guptac77ad88f90c4
diff --git a/frontend/src/container/MetricsApplication/index.tsx b/frontend/src/container/MetricsApplication/index.tsx
index f72fa1c04b..9922fbb8c2 100644
--- a/frontend/src/container/MetricsApplication/index.tsx
+++ b/frontend/src/container/MetricsApplication/index.tsx
@@ -55,19 +55,20 @@ function ServiceMetrics(): JSX.Element {
const externalMetrics = 'External Calls';
const getActiveKey = (): string => {
- if (tab === null) {
- return overMetrics;
+ switch (tab) {
+ case null: {
+ return overMetrics;
+ }
+ case dbCallMetrics: {
+ return dbCallMetrics;
+ }
+ case externalMetrics: {
+ return externalMetrics;
+ }
+ default: {
+ return overMetrics;
+ }
}
-
- if (tab === dbCallMetrics) {
- return dbCallMetrics;
- }
-
- if (tab === externalMetrics) {
- return externalMetrics;
- }
-
- return overMetrics;
};
const activeKey = getActiveKey();