Work

Observable Node.js on Kubernetes

Production observability stack, end to end

Year
2020
Language
JavaScript
Stars
2
Topics
kubernetes helm observability prometheus grafana jaeger

Overview

A reference setup showing how to take a Node.js service from a Dockerfile to a fully observable production workload on Kubernetes. Helm packages the deploy; Prometheus scrapes metrics; Grafana dashboards visualise them; Jaeger and Zipkin collect distributed traces via OpenTracing. The intent is a working example you can fork and adapt, not a turnkey product.

Features

  • Reference Node.js service Dockerised and deployable via Helm chart
  • Prometheus metrics scraping with custom application counters and histograms
  • Distributed tracing via OpenTracing, exported to both Jaeger and Zipkin
  • Grafana dashboards wired to the Prometheus instance out of the box
  • Horizontal pod autoscaling configured against CPU and custom metrics

Why it exists

Built as a learning template

The repo intentionally over-instruments a tiny Node.js service so every observability pillar (metrics, traces, logs) has a working, copy-pastable example. The Helm chart is broken into individual templates so each piece is easy to read in isolation.

Why both Jaeger and Zipkin

OpenTracing (now OpenTelemetry) lets you swap trace exporters without touching the application code. Wiring both backends in parallel demonstrates that the instrumentation is exporter-agnostic — a useful property in real deployments where the choice of tracing backend often comes later.

Tech stack

Service
Node.js Express OpenTracing
Packaging
Docker Helm Kubernetes
Observability
Prometheus Grafana Jaeger Zipkin

Architecture

graph LR
  REQ["Incoming<br/>Requests"] --> APP["Node.js App<br/>(replicas)"]
  APP -->|metrics| PR["Prometheus"]
  APP -->|traces| JG["Jaeger"]
  APP -->|traces| ZK["Zipkin"]
  PR --> GR["Grafana<br/>Dashboards"]
  H["Helm Chart"] -->|deploys| K["Kubernetes"]
  K --> APP
  K --> PR
  K --> GR
  K --> JG
  K --> ZK
  classDef app fill:#0a0a0a,stroke:#666,color:#fff
  classDef obs fill:#1e1e1e,stroke:#444,color:#ddd
  class APP,REQ app
  class PR,GR,JG,ZK obs
Architecture: Observable Node.js on Kubernetes