This is an automated email from the ASF dual-hosted git repository.
zqr10159 pushed a commit to branch 2.0.0
in repository https://gitbox.apache.org/repos/asf/hertzbeat.git
The following commit(s) were added to refs/heads/2.0.0 by this push:
new db36543e15 Suggest resource filters from signal evidence
db36543e15 is described below
commit db36543e15ff3433b491483bf119736db8bb8d0b
Author: Logic <[email protected]>
AuthorDate: Tue Jun 9 19:38:50 2026 +0800
Suggest resource filters from signal evidence
---
web-next/lib/signal-dashboards.test.ts | 3 +++
web-next/lib/signal-dashboards.ts | 5 +++++
2 files changed, 8 insertions(+)
diff --git a/web-next/lib/signal-dashboards.test.ts
b/web-next/lib/signal-dashboards.test.ts
index 52af4c51fb..9d0a0cd629 100644
--- a/web-next/lib/signal-dashboards.test.ts
+++ b/web-next/lib/signal-dashboards.test.ts
@@ -2100,6 +2100,7 @@ describe('signal dashboards API client', () => {
{ name: 'service.name', type: 'query', value: '' },
{ name: 'service.namespace', type: 'query', value: '' },
{ name: 'deployment.environment.name', type: 'query', value: '' },
+ { name: 'resourceFilter', type: 'textbox', value: '' },
{ name: 'hertzbeat.entity_id', type: 'textbox', value: '' },
{ name: 'hertzbeat.entity_type', type: 'dynamic', value: '' },
{ name: 'hertzbeat.entity_name', type: 'query', value: '' },
@@ -2110,6 +2111,7 @@ describe('signal dashboards API client', () => {
expect.objectContaining({ variableName: 'service.name', value:
'checkout', source: 'service' }),
expect.objectContaining({ variableName: 'service.namespace', value:
'payments', source: 'serviceNamespace' }),
expect.objectContaining({ variableName: 'deployment.environment.name',
value: 'prod', source: 'environment' }),
+ expect.objectContaining({ variableName: 'resourceFilter', value:
'db.system=postgresql', source: 'resourceFilter' }),
expect.objectContaining({ variableName: 'hertzbeat.entity_id', value:
'4200', source: 'entityId' }),
expect.objectContaining({ variableName: 'hertzbeat.entity_type', value:
'service', source: 'entityType' }),
expect.objectContaining({ variableName: 'hertzbeat.entity_name', value:
'Checkout API', source: 'entityName' }),
@@ -2155,6 +2157,7 @@ describe('signal dashboards API client', () => {
expect.objectContaining({ variableName: 'service.name', value:
'checkout', source: 'service', variableType: 'query' }),
expect.objectContaining({ variableName: 'service.namespace', value:
'payments', source: 'serviceNamespace', variableType: 'query' }),
expect.objectContaining({ variableName: 'deployment.environment.name',
value: 'prod', source: 'environment', variableType: 'query' }),
+ expect.objectContaining({ variableName: 'resourceFilter', value:
'db.system=postgresql', source: 'resourceFilter', variableType: 'textbox' }),
expect.objectContaining({ variableName: 'hertzbeat.entity_id', value:
'4200', source: 'entityId', variableType: 'textbox' }),
expect.objectContaining({ variableName: 'hertzbeat.entity_type', value:
'service', source: 'entityType', variableType: 'dynamic' }),
expect.objectContaining({ variableName: 'hertzbeat.entity_name', value:
'Checkout API', source: 'entityName', variableType: 'query' }),
diff --git a/web-next/lib/signal-dashboards.ts
b/web-next/lib/signal-dashboards.ts
index 009234337a..13fcc05c18 100644
--- a/web-next/lib/signal-dashboards.ts
+++ b/web-next/lib/signal-dashboards.ts
@@ -310,6 +310,7 @@ export type SignalDashboardRuntimeEvidenceFilterSource =
| 'serviceNamespace'
| 'environment'
| 'operation'
+ | 'resourceFilter'
| 'traceId'
| 'spanId'
| 'entityId'
@@ -3611,6 +3612,7 @@ const SERVICE_VARIABLE_NAMES = new Set(['service.name',
'servicename', 'service'
const SERVICE_NAMESPACE_VARIABLE_NAMES = new Set(['service.namespace',
'servicenamespace', 'service_namespace']);
const ENVIRONMENT_VARIABLE_NAMES = new Set(['deployment.environment.name',
'deployment_environment_name', 'environment']);
const OPERATION_VARIABLE_NAMES = new Set(['operation.name', 'operationname',
'operation_name', 'operation']);
+const RESOURCE_FILTER_VARIABLE_NAMES = new Set(['resourcefilter',
'resource.filter', 'resource_filter']);
const TRACE_ID_VARIABLE_NAMES = new Set(['traceid', 'trace.id', 'trace_id']);
const SPAN_ID_VARIABLE_NAMES = new Set(['spanid', 'span.id', 'span_id']);
const ENTITY_ID_VARIABLE_NAMES = new Set(['hertzbeat.entity_id',
'hertzbeat.entity.id', 'entityid', 'entity.id', 'entity_id']);
@@ -3626,6 +3628,7 @@ function evidenceFilterSourceForVariableName(name:
string): SignalDashboardRunti
if (SERVICE_NAMESPACE_VARIABLE_NAMES.has(normalizedName)) return
'serviceNamespace';
if (ENVIRONMENT_VARIABLE_NAMES.has(normalizedName)) return 'environment';
if (OPERATION_VARIABLE_NAMES.has(normalizedName)) return 'operation';
+ if (RESOURCE_FILTER_VARIABLE_NAMES.has(normalizedName)) return
'resourceFilter';
if (TRACE_ID_VARIABLE_NAMES.has(normalizedName)) return 'traceId';
if (SPAN_ID_VARIABLE_NAMES.has(normalizedName)) return 'spanId';
if (ENTITY_ID_VARIABLE_NAMES.has(normalizedName)) return 'entityId';
@@ -3647,6 +3650,7 @@ function evidenceFilterValues(row:
SignalDashboardRuntimeSyncTooltipRow): Record
serviceNamespace: syncTooltipIdentifier(row.serviceNamespace),
environment: breakoutValue(row, ['deployment.environment.name',
'environment']),
operation: syncTooltipIdentifier(row.operationName),
+ resourceFilter: syncTooltipIdentifier(row.resourceFilter),
traceId: syncTooltipIdentifier(row.traceId),
spanId: syncTooltipIdentifier(row.spanId),
entityId: breakoutValue(row, ['hertzbeat.entity_id',
'hertzbeat.entity.id', 'entity.id', 'entity_id']),
@@ -3747,6 +3751,7 @@ export function
buildSignalDashboardRuntimeEvidenceFilterSuggestions(
{ source: 'serviceNamespace', variableName: 'service.namespace',
variableType: 'query' },
{ source: 'environment', variableName: 'deployment.environment.name',
variableType: 'query' },
{ source: 'operation', variableName: 'operation.name', variableType:
'query' },
+ { source: 'resourceFilter', variableName: 'resourceFilter', variableType:
'textbox' },
{ source: 'entityId', variableName: 'hertzbeat.entity_id', variableType:
'textbox' },
{ source: 'entityType', variableName: 'hertzbeat.entity_type',
variableType: 'dynamic' },
{ source: 'entityName', variableName: 'hertzbeat.entity_name',
variableType: 'query' },
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]