Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/nudgebee-agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
9 changes: 5 additions & 4 deletions runner/pkg/enrichers/api_traces.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
11 changes: 6 additions & 5 deletions runner/pkg/enrichers/api_traces_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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"])
}
}

Expand Down
Loading