Skip to content

feat(helm): wire analytics-collector for frontend error capture#4

Open
dnplkndll wants to merge 1 commit into
feat/helm-chartfrom
feat/analytics-collector-wiring
Open

feat(helm): wire analytics-collector for frontend error capture#4
dnplkndll wants to merge 1 commit into
feat/helm-chartfrom
feat/analytics-collector-wiring

Conversation

@dnplkndll

Copy link
Copy Markdown

What changed

Wires the analytics-collector service into the Huly helm chart so browser-side errors actually reach our observability backend.

Before this PR the analytics-collector pod existed in cluster (applied out-of-band) but the front bundle had no way to discover it — every window.onerror / unhandledrejection died in the browser console.

Changes by concern

  • chart templates
    • templates/analytics-collector/{deployment,service}.yaml — new (selector app.kubernetes.io/name=analytics-collector to match the pre-existing live deployment for in-place adoption)
    • templates/configmap.yaml — adds ANALYTICS_COLLECTOR_URL (https://<domain>/_analytics) + _INTERNAL (http://analytics-collector:4017)
    • templates/front/deployment.yaml — front pod consumes ANALYTICS_COLLECTOR_URL from configmap → exposed via /config.json to the bundle
    • templates/ingress.yaml — adds /_analytics(/|$)(.*) → svc analytics-collector:4017
  • values
    • new top-level analyticsCollector.* block: enabled, image, tag (default v0.7.382 — pinned because the analytics-collector image is not part of forked builds), replicas, otelSecret.{name,endpointKey,headersKey}, resources

Test plan

  • helm template ... | kubectl diff — confirmed adoption path (label/annotation deltas only), no immutable-field collisions
  • adopted existing out-of-band resources (kubectl annotate/label to add helm meta) before helm upgrade
  • helm upgrade huly completed (revision 32) — rolled front + analytics-collector
  • in-cluster curl http://front:8080/config.json → contains ANALYTICS_COLLECTOR_URL
  • synthetic POST /collect from inside analytics-collector pod → HTTP 200 + log "Received batch: 1 events, 208 bytes"
  • analytics-collector boot log confirms OTEL endpoint = openobserve-openobserve-standalone.openobserve.svc:5080/api/default + Authorization header from openobserve-otlp Secret

Companion: ledoent/infra MR !37 (docs).

- Add analytics-collector deployment + service templates (was applied out-of-band)
- Add ANALYTICS_COLLECTOR_URL to configmap (consumed by front bundle via /config.json)
- Front deployment now exposes ANALYTICS_COLLECTOR_URL env
- Ingress backends list includes /_analytics → analytics-collector:4017
- New values block `analyticsCollector.*` (image, tag, replicas, OTEL secret ref, resources)

Verified on huly.hz.ledoweb.com: /config.json exposes the URL, synthetic POST to
/collect returns 200 and reportOTELError forwards to the openobserve-otlp secret
endpoint. Frontend window.onerror + unhandledrejection events will now flow.

Signed-off-by: Don Kendall <dkendall@ledoweb.com>
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.

1 participant