example(alb): add observability and alerting example - #14
Open
FloMicSch wants to merge 2 commits into
Open
Conversation
Add examples/alb-observability-and-alerting: an Application Load Balancer with HTTPS listener, self-signed certificate, active health check and a minimal WAF configuration in front of two backend VMs, wired to a STACKIT Observability instance via options.observability. The example creates the push credentials with stackit_loadbalancer_observability_credential, adds PromQL alert rules for target pool health, health check failures, throughput anomalies and missing metrics, LogQL alert rules for WAF blocks, an optional email or webhook receiver, and a Grafana dashboard that is imported through the UI. All metric names, labels and log fields were read from a live instance; the README documents the exported telemetry, how to discover it, and how to trigger every alert with the bundled backend application.
h3adex
reviewed
Sep 1, 2026
Move the backend application to files/server.py and inject it into cloud-init, drop the example-level .gitignore and the redundant depends_on of the WAF configuration.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds
examples/alb-observability-and-alerting: an Application Load Balancer with an HTTPS listener, a self-signed certificate, an active health check and a minimal WAF configuration in front of two backend VMs in different availability zones, shipping its metrics and logs into a STACKIT Observability instance viaoptions.observability.No existing example uses
options.observabilityorstackit_loadbalancer_observability_credential, and the WAF examples show how to block traffic but not how to see what was blocked. This example closes that day-2 gap:stackit_observability_instance,stackit_observability_credential,stackit_loadbalancer_observability_credential, with the instance'slogs_push_urlandmetrics_push_urlon the load balancerdashboards/alb-overview.json), imported once through the Grafana UIThe load balancer exports a fixed metric set (health checks, connections, bytes) and STACKIT does not document the names, so every metric name, label and log field used by the rules and the dashboard was read from a live instance; the README documents the exported telemetry and the discovery commands.
Tested
Deployed end to end in a sandbox project (
eu01, provider 0.113.0):AlbTargetPoolDegraded,AlbTargetPoolUnhealthy,AlbHealthCheckFailures,AlbTrafficSpike,AlbTrafficDrop,AlbMetricsAbsent,AlbWafBlockRateSpike,AlbWafCustomRuleTriggeredterraform fmt -recursiveandterraform validateclean, Apache license headers on all.tffiles, README tags, TODO and file naming checks pass,AGENTS.mdregeneratedKnown limitations
ObservabilitySamplesRejectedcould not be triggered on demand; it is built on the documented plan limit and theinstance_remote_write_samples_rejected_totalcounter of the instance itself.Checklist