The cross-harness, self-improving memory layer for AI agents. Join our community: https://discord.com/invite/zdNChS2fBu
Go agent-ai-cliagent-harnessesagent-securitybrowser-extensionciclaude-codecloudcodexcursordetection-engineeringjevknowledge-basememorymobile-device-managementobservabilitysecuritysecurity-information-and-event-managementsecurity-toolstelemetrytraces
OTLP forward: quote harness names in the collector config
Claude68aac8e6507c
diff --git a/cli/beacon/internal/endpoint/collector/collector.go b/cli/beacon/internal/endpoint/collector/collector.goindex d00897ba..57662acc 100644--- a/cli/beacon/internal/endpoint/collector/collector.go+++ b/cli/beacon/internal/endpoint/collector/collector.go@@ -157,7 +157,14 @@ func ConfigYAML(cfg endpointconfig.Config) string {// - secrets redacted, as for the HEC exporters (beacon_privacy).forwardPipelines, forwardFilterYAML := "", ""if forwardName != "" {- forwardFilterYAML = " " + ForwardFilterProcessor + ":\n harnesses: [" + strings.Join(cfg.Destinations.OTLPForward.Harnesses, ", ") + "]\n"+ // Quoted like every other value the forward renders: a harness name the operator typed can+ // hold YAML syntax (`#`, `: `), and a config the collector cannot parse stops Beacon's own+ // pipelines too.+ quoted := make([]string, 0, len(cfg.Destinations.OTLPForward.Harnesses))+ for _, name := range cfg.Destinations.OTLPForward.Harnesses {+ quoted = append(quoted, fmt.Sprintf("%q", name))+ }+ forwardFilterYAML = " " + ForwardFilterProcessor + ":\n harnesses: [" + strings.Join(quoted, ", ") + "]\n"for _, signal := range []string{"logs", "traces", "metrics"} {apiBody := ""if signal == "logs" {diff --git a/cli/beacon/internal/endpoint/collector/collector_test.go b/cli/beacon/internal/endpoint/collector/collector_test.goindex a696f21d..a924a42b 100644--- a/cli/beacon/internal/endpoint/collector/collector_test.go+++ b/cli/beacon/internal/endpoint/collector/collector_test.go@@ -452,7 +452,7 @@ func TestConfigYAMLForwardsFilteredRedactedOTLPWhenConfigured(t *testing.T) {" sending_queue:\n enabled: true\n num_consumers: 2\n queue_size: 20\n"," retry_on_failure:\n enabled: true\n max_elapsed_time: 120s\n"," tls:\n ca_file: \"/tmp/ca.pem\"\n",- " beacon_privacy: {}\n beacon_forward_filter:\n harnesses: [claude_code, codex_cli, codex_desktop]\n",+ " beacon_privacy: {}\n beacon_forward_filter:\n harnesses: [\"claude_code\", \"codex_cli\", \"codex_desktop\"]\n"," logs/forward:\n receivers: [otlp]\n processors: [memory_limiter, beacon_forward_filter, claude_api_body, beacon_privacy, batch]\n exporters: [" + tc.exporter + "]\n"," traces/forward:\n receivers: [otlp]\n processors: [memory_limiter, beacon_forward_filter, beacon_privacy, batch]\n"," metrics/forward:\n receivers: [otlp]\n processors: [memory_limiter, beacon_forward_filter, beacon_privacy, batch]\n",@@ -475,3 +475,26 @@ func TestConfigYAMLHasNoForwardWhenDisabled(t *testing.T) {t.Fatalf("ConfigYAML has a forward with none configured:\n%s", yaml)}}++// Harness names are typed by the operator, so YAML syntax in one must not break the config the+// collector shares with Beacon's own pipelines.+func TestConfigYAMLQuotesForwardHarnessNames(t *testing.T) {+ cfg := testConfig(t)+ cfg.Destinations = &endpointconfig.Destinations{OTLPForward: &endpointconfig.OTLPForward{+ Endpoint: "otel.example:4317",+ Harnesses: []string{"claude_code", "my agent #2", "foo: bar"},+ }}+ endpointconfig.NormalizeDestinations(&cfg)+ var parsed struct {+ Processors map[string]struct {+ Harnesses []string `yaml:"harnesses"`+ } `yaml:"processors"`+ }+ if err := yaml.Unmarshal([]byte(ConfigYAML(cfg)), &parsed); err != nil {+ t.Fatalf("collector config does not parse: %v", err)+ }+ got := parsed.Processors["beacon_forward_filter"].Harnesses+ if strings.Join(got, "|") != "claude_code|my agent #2|foo: bar" {+ t.Fatalf("harnesses = %q", got)+ }+}