diff --git a/charts/nudgebee-agent/values.yaml b/charts/nudgebee-agent/values.yaml index bbf14b10..e3beaa5d 100644 --- a/charts/nudgebee-agent/values.yaml +++ b/charts/nudgebee-agent/values.yaml @@ -65,7 +65,7 @@ runnerServiceAccount: runner: image: repository: ghcr.io/nudgebee/nudgebee-agent - tag: 2026-08-12T06-01-54_7ec58f7701909a3ce172ad2a9235f8b15255e363 + tag: 2026-08-12T08-10-04_e13ce92bc8c238e883d050b1276c6128b2c8fb44 # Image template the pod_profiler action launches debugger pods from. # The agent substitutes `{}` for the variant (bpf, jvm, python, perf, ruby). # Surfaces as PROFILER_IMAGE; leave empty to fall back to the binary default. diff --git a/runner/pkg/enrichers/api_traces.go b/runner/pkg/enrichers/api_traces.go index 278aa486..739c62e4 100644 --- a/runner/pkg/enrichers/api_traces.go +++ b/runner/pkg/enrichers/api_traces.go @@ -55,10 +55,11 @@ func buildTracesPayload(ctx context.Context, ch *clickhouse.Client, params map[s "data": []map[string]any{}, } if ch == nil { - // The legacy get_application_traces would raise on the run_query call - // if CH were down; we surface the same `error` field so the caller - // can show it in the UI. - out["error"] = "clickhouse: not configured" + // ClickHouse isn't configured on this agent. Return an empty—but + // successful—traces payload (no `error` key) so the backend traces + // parser renders "no traces" instead of surfacing a hard error to + // the user. Matches the legacy nudgebee_actions.get_application_traces, + // which returns an empty result when the trace store is absent. return out } diff --git a/runner/pkg/enrichers/api_traces_test.go b/runner/pkg/enrichers/api_traces_test.go index 166ac73f..34fab0c0 100644 --- a/runner/pkg/enrichers/api_traces_test.go +++ b/runner/pkg/enrichers/api_traces_test.go @@ -12,9 +12,10 @@ import ( ) // TestApiTraces_NoClickHouseReturnsEmpty covers the "CH not configured" -// path. The legacy get_application_traces would crash on the run_query -// call in that case; we surface a clean empty Finding with `error` set -// so the api-server caller can render the empty state. +// path. We return a clean, successful empty Finding with NO `error` key, +// so the backend traces parser renders "no traces" rather than surfacing +// a hard error. Matches the legacy get_application_traces empty-result +// behavior when the trace store is absent. func TestApiTraces_NoClickHouseReturnsEmpty(t *testing.T) { a := NewAPITracesEnricher(nil, "acc-1") resp, err := a.Handler()(context.Background(), map[string]any{ @@ -35,8 +36,8 @@ func TestApiTraces_NoClickHouseReturnsEmpty(t *testing.T) { if rows := body["data"].([]any); len(rows) != 0 { t.Errorf("data = %v; want []", rows) } - if body["error"] != "clickhouse: not configured" { - t.Errorf("error = %v", body["error"]) + if _, hasErr := body["error"]; hasErr { + t.Errorf("expected no error key when CH unconfigured; got error = %v", body["error"]) } }