Skip to main content

Create a Monitoring Stack

The create-monitoring-stack template deploys a full observability stack — Prometheus, Grafana, and Alertmanager — in a Kubernetes cluster or via Docker Compose. The stack is registered as a kind: resource entity in the catalog, and the Grafana Plugin can embed its dashboards directly in entity pages.

Prerequisites

  • ForgePortal is running — see Quick Start
  • Your role is developer or higher
  • For Kubernetes: cluster is running and accessible; Helm 3 is installed
  • For Docker Compose: Docker is installed locally

Step 1 — Open the Template

  1. Click Templates in the navigation.
  2. Find the Create Monitoring Stack card.
  3. Click "Create →".

Step 2 — Fill the Wizard

FieldExampleNotes
Stack nameprod-monitoringBecomes the Helm release name / compose service prefix
Destinationkuberneteskubernetes or docker-compose
NamespacemonitoringKubernetes only; created if it doesn't exist
Grafana admin passwordchangeme-in-prodInitial Grafana password — change after first login
Prometheus retention15dHow long metrics are kept
Ownerteam-sreRegistered in the catalog

Step 3 — Watch the Run

StepWhat happens
template.renderHelm values or Compose file generated
scm.openPullRequestPR opened in infra repo (Kubernetes only)
catalog.registerEntityresource:prod-monitoring registered in catalog

For Docker Compose, the docker-compose.monitoring.yml is shown as a step output — copy it directly.


Step 4 — Deploy the Stack

Kubernetes

Merge the PR in your infra repo, then install using the kube-prometheus-stack chart:

helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update

helm upgrade --install prod-monitoring prometheus-community/kube-prometheus-stack \
--namespace monitoring --create-namespace \
-f infra/monitoring/prod-monitoring/helm-values.yaml

Verify:

kubectl get pods -n monitoring
# prometheus-prod-monitoring-... 1/1 Running
# grafana-prod-monitoring-... 1/1 Running
# alertmanager-prod-monitoring-... 1/1 Running

Access Grafana:

kubectl port-forward -n monitoring svc/prod-monitoring-grafana 3030:80
# Open http://localhost:3030 — login: admin / <your password>

Docker Compose

Paste the generated block into your existing docker-compose.yml or run it standalone:

docker compose -f docker-compose.monitoring.yml up -d
# Grafana: http://localhost:3000
# Prometheus: http://localhost:9090

Step 5 — Connect the Grafana Plugin

Once Grafana is running, configure the Grafana plugin so dashboards appear on entity pages.

Add to your forgeportal.yaml:

plugins:
- name: grafana
config:
baseUrl: http://localhost:3030 # or your Grafana URL
# orgId: 1 # optional, default 1

Then add the annotation to any entity's entity.yaml to show a dashboard panel:

metadata:
annotations:
forgeportal.dev/grafana-dashboard-url: "http://localhost:3030/d/abc123/my-dashboard"

The Grafana tab appears automatically on that entity's detail page.

See Grafana Plugin for the full reference.


Step 6 — See the Entity in the Catalog

Go to Catalog → search for prod-monitoring. The kind: resource entity shows the stack details.

Services can declare they send metrics to this stack:

spec:
dependsOn:
- resource:prod-monitoring

Pre-configured Dashboards

The generated Helm values include the following Grafana dashboards out of the box:

DashboardIDWhat it shows
Kubernetes / Compute Resources / Cluster315CPU, memory, pod count
Kubernetes / Networking12124Network I/O
Node Exporter Full1860Host CPU, disk, memory
NGINX Ingress9614Request rate, latency

Next Steps

  • Use the Grafana plugin on your service entities — Grafana Plugin
  • Set up alerts — edit the generated Alertmanager config in the infra repo
  • Full SRE flowGolden Paths Overview