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 c979604973 Fix three-signal handoff queries
c979604973 is described below

commit c9796049734b02e4ee8b9d7b4ada52074bbf36a4
Author: Logic <[email protected]>
AuthorDate: Mon Jun 15 02:01:38 2026 +0800

    Fix three-signal handoff queries
---
 .../service/impl/OtlpIngestionWorkspaceServiceImpl.java          | 1 +
 .../service/impl/OtlpIngestionWorkspaceServiceImplTest.java      | 2 ++
 web-next/lib/log-manage/view-model.test.ts                       | 4 ++--
 web-next/lib/log-manage/view-model.ts                            | 9 +++++++--
 4 files changed, 12 insertions(+), 4 deletions(-)

diff --git 
a/hertzbeat-observability/src/main/java/org/apache/hertzbeat/observability/ingestion/service/impl/OtlpIngestionWorkspaceServiceImpl.java
 
b/hertzbeat-observability/src/main/java/org/apache/hertzbeat/observability/ingestion/service/impl/OtlpIngestionWorkspaceServiceImpl.java
index 9b5a176be3..ca1080546a 100644
--- 
a/hertzbeat-observability/src/main/java/org/apache/hertzbeat/observability/ingestion/service/impl/OtlpIngestionWorkspaceServiceImpl.java
+++ 
b/hertzbeat-observability/src/main/java/org/apache/hertzbeat/observability/ingestion/service/impl/OtlpIngestionWorkspaceServiceImpl.java
@@ -1072,6 +1072,7 @@ public class OtlpIngestionWorkspaceServiceImpl implements 
OtlpIngestionWorkspace
             return null;
         }
         List<String> matchers = new ArrayList<>();
+        matchers.add("__name__=~\".+\"");
         matchers.add("service_name=\"" + 
escapePromqlLabelValue(context.getServiceName()) + "\"");
         if (StringUtils.hasText(context.getServiceNamespace())) {
             matchers.add("service_namespace=\"" + 
escapePromqlLabelValue(context.getServiceNamespace()) + "\"");
diff --git 
a/hertzbeat-observability/src/test/java/org/apache/hertzbeat/observability/ingestion/service/impl/OtlpIngestionWorkspaceServiceImplTest.java
 
b/hertzbeat-observability/src/test/java/org/apache/hertzbeat/observability/ingestion/service/impl/OtlpIngestionWorkspaceServiceImplTest.java
index e9e6be6f97..71b1772da3 100644
--- 
a/hertzbeat-observability/src/test/java/org/apache/hertzbeat/observability/ingestion/service/impl/OtlpIngestionWorkspaceServiceImplTest.java
+++ 
b/hertzbeat-observability/src/test/java/org/apache/hertzbeat/observability/ingestion/service/impl/OtlpIngestionWorkspaceServiceImplTest.java
@@ -1567,6 +1567,7 @@ class OtlpIngestionWorkspaceServiceImplTest {
         verify(metricQueryRepository).queryPromqlRange(
                 eq("otlp-related-metrics-inventory"),
                 argThat(query -> query.contains("sum by (__name__)")
+                        && query.contains("__name__=~\".+\"")
                         && query.contains("service_name=\"checkout\"")
                         && query.contains("service_namespace=\"commerce\"")),
                 eq(1_000L),
@@ -1636,6 +1637,7 @@ class OtlpIngestionWorkspaceServiceImplTest {
         verify(metricQueryRepository).queryPromqlRange(
                 eq("otlp-related-metrics-inventory"),
                 argThat(query -> query.contains("sum by (__name__)")
+                        && query.contains("__name__=~\".+\"")
                         && query.contains("service_name=\"checkout\"")
                         && query.contains("service_namespace=\"commerce\"")),
                 eq(1_000L),
diff --git a/web-next/lib/log-manage/view-model.test.ts 
b/web-next/lib/log-manage/view-model.test.ts
index cb08703f3d..bc517f3430 100644
--- a/web-next/lib/log-manage/view-model.test.ts
+++ b/web-next/lib/log-manage/view-model.test.ts
@@ -744,7 +744,7 @@ describe('log view model', () => {
     );
 
     const traceParams = new URL(result.traceHref, 
'https://example.com').searchParams;
-    expect(traceParams.get('operationName')).toBe('POST /checkout');
+    expect(traceParams.get('operationName')).toBeNull();
     expect(traceParams.get('attributeFilter')).toBeNull();
 
     const metricsParams = new URL(result.metricsHref, 
'https://example.com').searchParams;
@@ -788,7 +788,7 @@ describe('log view model', () => {
     expect(traceParams.get('spanId')).toBeNull();
     expect(traceParams.get('serviceName')).toBe('checkout');
     expect(traceParams.get('serviceNamespace')).toBe('payments');
-    expect(traceParams.get('operationName')).toBe('/checkout/:id');
+    expect(traceParams.get('operationName')).toBeNull();
     
expect(traceParams.get('attributeFilter')).toBe('http.route="/checkout/:id"');
   });
 
diff --git a/web-next/lib/log-manage/view-model.ts 
b/web-next/lib/log-manage/view-model.ts
index 6aa4a872e4..7ca84918d4 100644
--- a/web-next/lib/log-manage/view-model.ts
+++ b/web-next/lib/log-manage/view-model.ts
@@ -722,12 +722,16 @@ export function buildLogHandoffLinks(
   );
   const traceId = firstText(selectedLog?.traceId, routeContext.traceId);
   const spanId = firstText(selectedLog?.spanId, routeContext.spanId);
-  const operationName = firstText(
+  const traceOperationName = firstText(
     readAttribute(selectedLog?.attributes, 'operation.name'),
     readAttribute(selectedLog?.attributes, 'span.name'),
-    readAttribute(selectedLog?.attributes, 'http.route'),
     routeContext.operationName
   );
+  const operationName = firstText(
+    traceOperationName,
+    readAttribute(selectedLog?.attributes, 'http.route'),
+    readAttribute(selectedLog?.attributes, 'http_route')
+  );
   const metricsFilter = buildLogMetricsResourceFilter(selectedLog);
   const signalDraft = options?.alertDraft;
   const signalContext: SignalRouteContext = {
@@ -750,6 +754,7 @@ export function buildLogHandoffLinks(
 
   const traceContext: SignalRouteContext = {
     ...signalContext,
+    operationName: traceOperationName,
     returnTo: stripReturnLabelFromHref(options?.traceReturnTo || 
signalContext.returnTo)
   };
   const metricsContext: SignalRouteContext = {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to