fix(telemetry): address Phase 2 code review findings

- Move node health attribute strings to compile-time constants in
  SpanNames.h (attr::nodeAmendmentBlocked, attr::nodeServerState)
- Add Tempo search filters for node health attributes
- Remove unnecessary .c_str() on strOperatingMode() return
- Add samplingRatio clamping test (values > 1.0 and < 0.0)
- Fix Task 2.3 status: delivered in Phase 1c, not Phase 2

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Pratik Mankawde
2026-04-20 15:41:23 +01:00
parent 810999a006
commit c59ea77bdc
5 changed files with 35 additions and 4 deletions

View File

@@ -106,3 +106,16 @@ TEST(TelemetryConfig, null_telemetry_factory)
tel->start();
tel->stop();
}
TEST(TelemetryConfig, sampling_ratio_clamped)
{
Section section;
section.set("sampling_ratio", "2.5");
auto setup = telemetry::setup_Telemetry(section, "nHUtest123", "2.0.0", 0);
EXPECT_DOUBLE_EQ(setup.samplingRatio, 1.0);
Section section2;
section2.set("sampling_ratio", "-0.5");
auto setup2 = telemetry::setup_Telemetry(section2, "nHUtest123", "2.0.0", 0);
EXPECT_DOUBLE_EQ(setup2.samplingRatio, 0.0);
}