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 8f85633368 Add three-signal alpha cutoff evidence report
8f85633368 is described below
commit 8f856333685f1bfb2e6e9601cdd4f5c1091c1f23
Author: Logic <[email protected]>
AuthorDate: Tue Jun 9 18:00:20 2026 +0800
Add three-signal alpha cutoff evidence report
---
.../scripts/three-signal-alpha-cutoff-report.mjs | 141 +++++++++++++++++++++
.../three-signal-alpha-cutoff-report.test.ts | 38 ++++++
2 files changed, 179 insertions(+)
diff --git a/web-next/scripts/three-signal-alpha-cutoff-report.mjs
b/web-next/scripts/three-signal-alpha-cutoff-report.mjs
new file mode 100644
index 0000000000..e6c3d08be8
--- /dev/null
+++ b/web-next/scripts/three-signal-alpha-cutoff-report.mjs
@@ -0,0 +1,141 @@
+import { readFileSync } from 'node:fs';
+import path from 'node:path';
+import process from 'node:process';
+import { fileURLToPath } from 'node:url';
+
+const scriptDir = path.dirname(fileURLToPath(import.meta.url));
+const webNextRoot = path.resolve(scriptDir, '..');
+const repoRoot = path.resolve(webNextRoot, '..');
+
+function hasAll(source, needles) {
+ return needles.every(needle => source.includes(needle));
+}
+
+function collapsed(source) {
+ return source.replace(/\s+/g, ' ');
+}
+
+export const THREE_SIGNAL_ALPHA_CUTOFF_ITEMS = [
+ {
+ key: 'alpha-cutoff-doc',
+ label: 'Alpha docs define the three-signal SigNoz-alignment cutoff without
claiming full parity',
+ verify: files => {
+ const doc = collapsed(files.alphaPreview);
+ return hasAll(files.alphaPreview, [
+ '## Three-Signal SigNoz-Alignment Alpha Cutoff',
+ 'not as a full parity claim',
+ 'TRACE_ID=6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b6b bash
script/dev/run-three-signal-live-proof.sh'
+ ]) && hasAll(doc, [
+ 'does not claim full SigNoz parity',
+ 'public dashboard sharing',
+ 'Terraform-managed dashboards',
+ 'ClickHouse SQL dashboard builder',
+ 'log pipeline builder',
+ 'automatic APM RED metric derivation from traces'
+ ]);
+ }
+ },
+ {
+ key: 'live-proof-default',
+ label: 'Default live proof runs saved-view replay, service overview, and
operation drilldown',
+ verify: files => hasAll(files.liveProofScript, [
+
'jdbc:h2:mem:hb_live_smoke;MODE=MYSQL;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE',
+ 'promotes logs, traces, and metrics saved views into a persisted replay
dashboard',
+ 'saves a service overview dashboard from URL service and entity context',
+ 'saves an operation drilldown dashboard from URL operation context',
+ 'READY_ATTEMPTS="${READY_ATTEMPTS:-300}"'
+ ])
+ },
+ {
+ key: 'service-overview-evidence',
+ label: 'Service overview dashboard is covered by live browser/API
persistence evidence',
+ verify: files => hasAll(files.liveBrowserSmoke, [
+ 'buildSignalServiceOverviewDashboard',
+ 'data-dashboard-service-overview-action="save"',
+ 'data-dashboard-service-overview-context="ready"',
+ 'Checkout API service overview',
+ "toHaveCount(18",
+ 'Service overview request rate: service.name=checkout',
+ 'Service overview exceptions: service.name=checkout',
+ 'Service overview firing alerts: service.name=checkout'
+ ])
+ },
+ {
+ key: 'operation-drilldown-evidence',
+ label: 'Operation drilldown dashboard is covered by live browser/API
persistence evidence',
+ verify: files => hasAll(files.liveBrowserSmoke, [
+ 'buildSignalOperationDrilldownDashboard',
+ 'data-dashboard-operation-drilldown-action="save"',
+ 'data-dashboard-operation-drilldown-context="ready"',
+ 'Checkout API POST /checkout operation drilldown',
+ "toHaveCount(8",
+ 'operation%3D%22POST+%2Fcheckout%22',
+ 'attributeFilter=http.route%3APOST+%2Fcheckout',
+ 'operationName=POST+%2Fcheckout'
+ ])
+ },
+ {
+ key: 'runtime-dimension-boundary',
+ label: 'Runtime signal dimensions remain drilldown dimensions, not
long-lived entity identities',
+ verify: files => {
+ const doc = collapsed(files.alphaPreview);
+ return hasAll(doc, [
+ 'Runtime signal dimensions such as `trace_id`, `span.name`,
`http.route`',
+ 'must not be promoted into long-lived `ObserveEntity` identities'
+ ]) && hasAll(files.identityRegistry, [
+ 'RUNTIME_SIGNAL_DIMENSION_KEYS',
+ '"trace_id"',
+ '"span.name"',
+ '"http.route"',
+ '"exception.type"',
+ 'isRuntimeSignalDimensionKey'
+ ]) && hasAll(files.identityRegistryTest, [
+
'assertTrue(EntityCanonicalIdentityRegistry.isRuntimeSignalDimensionKey("trace_id"))',
+
'assertFalse(EntityCanonicalIdentityRegistry.isCanonicalOtelResourceKey("http.route"))',
+ 'assertEquals(0,
EntityCanonicalIdentityRegistry.defaultPriority("trace_id"))'
+ ]);
+ }
+ }
+];
+
+export function readThreeSignalAlphaCutoffFiles(rootDir = repoRoot) {
+ const readRepoFile = relativePath => readFileSync(path.join(rootDir,
relativePath), 'utf8');
+ return {
+ alphaPreview: readRepoFile('docs/alpha-preview.md'),
+ liveProofScript: readRepoFile('script/dev/run-three-signal-live-proof.sh'),
+ liveBrowserSmoke:
readRepoFile('web-next/scripts/dashboard-source-edit-live-browser-smoke.spec.ts'),
+ identityRegistry:
readRepoFile('hertzbeat-common-core/src/main/java/org/apache/hertzbeat/common/observability/model/EntityCanonicalIdentityRegistry.java'),
+ identityRegistryTest:
readRepoFile('hertzbeat-common-core/src/test/java/org/apache/hertzbeat/common/observability/model/EntityCanonicalIdentityRegistryTest.java')
+ };
+}
+
+export function evaluateThreeSignalAlphaCutoff(files =
readThreeSignalAlphaCutoffFiles()) {
+ return THREE_SIGNAL_ALPHA_CUTOFF_ITEMS.map(item => ({
+ key: item.key,
+ label: item.label,
+ passed: Boolean(item.verify(files))
+ }));
+}
+
+export function verifyThreeSignalAlphaCutoff(files =
readThreeSignalAlphaCutoffFiles()) {
+ const results = evaluateThreeSignalAlphaCutoff(files);
+ const failures = results.filter(result => !result.passed);
+ if (failures.length > 0) {
+ throw new Error(`Three-signal alpha cutoff failed: ${failures.map(result
=> result.key).join(', ')}`);
+ }
+ return results;
+}
+
+export function formatThreeSignalAlphaCutoffReport(results =
evaluateThreeSignalAlphaCutoff()) {
+ return [
+ 'Three-signal alpha cutoff report',
+ ...results.map(result => `${result.passed ? 'ok' : 'missing'}
${result.key}: ${result.label}`)
+ ].join('\n');
+}
+
+const isDirectExecution = process.argv[1] && path.resolve(process.argv[1]) ===
fileURLToPath(import.meta.url);
+
+if (isDirectExecution) {
+ const results = verifyThreeSignalAlphaCutoff();
+ console.log(formatThreeSignalAlphaCutoffReport(results));
+}
diff --git a/web-next/scripts/three-signal-alpha-cutoff-report.test.ts
b/web-next/scripts/three-signal-alpha-cutoff-report.test.ts
new file mode 100644
index 0000000000..a4f1298d1e
--- /dev/null
+++ b/web-next/scripts/three-signal-alpha-cutoff-report.test.ts
@@ -0,0 +1,38 @@
+import { describe, expect, it } from 'vitest';
+// @ts-expect-error -- the report script is exercised through its runtime ESM
entrypoint.
+import {
+ THREE_SIGNAL_ALPHA_CUTOFF_ITEMS,
+ evaluateThreeSignalAlphaCutoff,
+ formatThreeSignalAlphaCutoffReport,
+ readThreeSignalAlphaCutoffFiles,
+ verifyThreeSignalAlphaCutoff
+} from './three-signal-alpha-cutoff-report.mjs';
+
+describe('three-signal alpha cutoff report', () => {
+ it('passes every source-backed alpha cutoff evidence item in the current
repo', () => {
+ const results = verifyThreeSignalAlphaCutoff();
+
+ expect(results.every(result => result.passed)).toBe(true);
+ expect(results.map(result => result.key)).toEqual([
+ 'alpha-cutoff-doc',
+ 'live-proof-default',
+ 'service-overview-evidence',
+ 'operation-drilldown-evidence',
+ 'runtime-dimension-boundary'
+ ]);
+ expect(formatThreeSignalAlphaCutoffReport(results)).toContain('ok
operation-drilldown-evidence');
+ });
+
+ it('reports the exact missing evidence key when operation drilldown live
proof is removed', () => {
+ const files = readThreeSignalAlphaCutoffFiles();
+ const withoutOperationProof = {
+ ...files,
+ liveBrowserSmoke:
files.liveBrowserSmoke.replace('data-dashboard-operation-drilldown-action="save"',
'')
+ };
+ const results = evaluateThreeSignalAlphaCutoff(withoutOperationProof);
+
+ expect(THREE_SIGNAL_ALPHA_CUTOFF_ITEMS).toHaveLength(5);
+ expect(results.find(result => result.key ===
'operation-drilldown-evidence')?.passed).toBe(false);
+ expect(() =>
verifyThreeSignalAlphaCutoff(withoutOperationProof)).toThrow('operation-drilldown-evidence');
+ });
+});
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]