Skip to content

fix(legacy-parity): wire prometheus_additional_labels + loud unconfigured-datasource logs#513

Merged
mayankpande88 merged 3 commits into
mainfrom
fix/legacy-config-parity
Jul 9, 2026
Merged

fix(legacy-parity): wire prometheus_additional_labels + loud unconfigured-datasource logs#513
mayankpande88 merged 3 commits into
mainfrom
fix/legacy-config-parity

Conversation

@mayankpande88

Copy link
Copy Markdown
Contributor

Why

Diagnosing a customer migrating from the legacy (Robusta) agent to the Go agent surfaced two gaps that made a simple misconfig take far too long to find. The customer bumped only runner.image.tag to the Go image on their legacy chart, which routes globalConfig.prometheus_url into the Robusta global_config ConfigMap (what the Python agent read) — never into the PROMETHEUS_URL env var the Go agent reads. Result: SigNoz Connected, Prometheus Disconnected, with correct values and a valid token.

What

1. Chart: wire globalConfig.prometheus_additional_labels.
The Go agent reads PROMETHEUS_ADDITIONAL_LABELS (main.go), but the chart only wired prometheus_url / prometheus_headers — so the legacy multi-cluster label map (e.g. {k8s_cluster: aws-otr-eks-staging}) was silently dropped even on a clean migration. Now converted from the YAML map to the key=value,key=value form the runner parses. Verified via helm template:

PROMETHEUS_ADDITIONAL_LABELS: "k8s_cluster=aws-otr-eks-staging"

2. Agent: make "not configured" loud instead of silent.

  • WARN prometheus disabled: PROMETHEUS_URL not set and none autodiscovered … — names the common cause (image-tag-only migration on a chart that never sets the env). Previously this was only inferable from the absence of a prometheus enabled line.
  • INFO logs provider selected provider=… url=… — logs-provider selection is priority-ordered (pinot → ES → signoz → loki), so a configured provider can be masked by a higher-priority one (a stray ELASTICSEARCH_URL hiding SigNoz). Making the winner explicit turns "I configured X but see Y" into a one-line grep.

Tests

  • TestSelectedLogsProvider_Precedence — keeps the startup summary in sync with the prober (incl. stray-ES-doesn't-mask-SigNoz).
  • helm template renders the label env only when the map is set (empty map → nothing).
  • go build, go vet, go test ./..., gofmt all pass.

Chart bumped to 0.1.8.

Note

This helps future migrations onto the new chart. The immediate customer is on the legacy chart and needs to move to the new chart (or set the env explicitly) — a chart migration, not an image-tag bump. That process gap is called out for follow-up.

…ured-datasource logs

Two gaps surfaced migrating a customer from the legacy agent to the Go agent
on their existing (legacy) chart:

- The Go agent reads PROMETHEUS_ADDITIONAL_LABELS, but the chart only wired
  globalConfig.prometheus_url/prometheus_headers — so the legacy
  prometheus_additional_labels map (e.g. {k8s_cluster: ...}) was dropped. Wire
  it, converting the YAML map to the key=value,key=value form the runner parses.

- Missing config failed silently: 'Prometheus disabled' was only inferable from
  the absence of a 'prometheus enabled' line. Add explicit logs:
    * WARN when PROMETHEUS_URL is unset (names the common cause: image-tag-only
      migration on a chart that never set the env)
    * INFO 'logs provider selected' naming the winner, so a masked provider
      (stray ELASTICSEARCH_URL hiding SigNoz) is a one-line grep

Chart bumped to 0.1.8.
@mayankpande88 mayankpande88 requested a review from a team as a code owner July 9, 2026 09:38
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

📦 Image Tags Updated

I've automatically updated the image tags in `charts/nudgebee-agent/values.yaml` to the latest versions from GHCR for the `main` branch.

The image tags are now synchronized with the latest builds and ready for release.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for configuring additional Prometheus labels in the Helm chart, adds explicit warning logs when Prometheus is disabled, and logs the selected logs provider at startup. Feedback highlights opportunities to improve robustness, such as using %v in Helm templates to handle non-string label values, replacing non-ASCII characters in log messages to avoid encoding issues, and adding a defensive nil check in selectedLogsProvider.

Comment thread charts/nudgebee-agent/templates/runner.yaml Outdated
Comment thread runner/cmd/agent/main.go Outdated
Comment thread runner/cmd/agent/main.go
- prometheus_additional_labels: printf %v so non-string values (ints/bools)
  render cleanly instead of %!s(int=...)
- drop em-dash from the prometheus-disabled warn for SIEM/log-parser safety
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

📦 Image Tags Updated

I've automatically updated the image tags in `charts/nudgebee-agent/values.yaml` to the latest versions from GHCR for the `main` branch.

The image tags are now synchronized with the latest builds and ready for release.

@mayankpande88 mayankpande88 merged commit a8e27ef into main Jul 9, 2026
7 checks passed
@mayankpande88 mayankpande88 deleted the fix/legacy-config-parity branch July 9, 2026 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants