What you will learn in this TP
- Describe alerts and SLOs in Terraform
- Configure thresholds, window and loss of signal
- Route an issue to a destination with a workflow
- Test an alert end to end
All steps and instructions are shown. Recommended for this lab: autonomous
Introduction #
Context. The shop goes to production. The team requires alerts and the SLO to be reviewed and versioned like code: you describe them in Terraform, then prove the alert really arrives.
Prerequisites: a free New Relic account (license key), a machine with Docker, curl and jq, the Lab 1 application running, Terraform 1.6 or later · Estimated time: 60 min
An alert policy, an error rate condition, a workflow to your e-mail and an availability SLO, created and destroyed by Terraform, with a notification received.Setup #
Guided steps, with their solution.
1. Prepare Terraform
Why? The provider acts with a user key, not with the license key which only sends data.
Create a USER key, exportNEW_RELIC_API_KEY,NEW_RELIC_ACCOUNT_IDandNEW_RELIC_REGION, writemain.tfand runterraform plan. How many resources will be created?2. Understand the condition
Why? Each setting changes when on-call gets woken up: you must be able to justify it.
Explainthreshold_occurrences = "all",aggregation_delayand the threeexpiration_*settings. Why open an incident on expiration?3. Apply
Why? Applying from code guarantees production and the Git repository are identical.
Apply the configuration with your address, then find the policy, the workflow and the SLO in the UI.4. Trigger the alert
Why? An alert that was never tested is an alert nobody knows works.
For 8 minutes, send orders whose number is a multiple of 17 (all failing), follow the incident then the issue, and check the e-mail arrives.5. Read the SLO and destroy
Why? The error budget shows the incident's effect on the promised reliability; destroying avoids orphan alerts.
Open Service levels: what share of the weekly error budget did the incident consume? Then destroy every resource and stop the containers.
Validate your work
Check that each goal above is reached and that you get the result described in the introduction.
Difficulty level : ●●●●○ (4/5)
My progress
Sign in to track your progress and take notes. Sign in
💬 Questions about this lesson
No questions yet: be the first to ask for help or share your configuration.
Recommended Articles
Alerts, connectors and SLOs in Kibana
Create alert rules in Kibana (Elasticsearch query, ES|QL, custom threshold, logs), configure conn...
New Relic dashboards: building, sharing and analysing
Building useful dashboards in New Relic: NRQL widgets, chart choice, template variables, facet li...
Site Reliability Guardian in Dynatrace
Validating each release with Site Reliability Guardian (SRG): guardians and DQL objectives, fixed...
XLA: why user experience is the new standard of observability
Discover the concept of XLAs (Experience Level Agreements), how they differ from traditional SLAs...
Time-based vs event-based SLO: understanding, computing and choosing (with the Qonto example)
Differences between time-based SLOs (time slices, uptime) and event-based SLOs (good events over ...
Alerts and pipelines in OpenObserve
Create a template, a destination and an alert, avoid the SSRF webhook block and process data with...
Incidents and automation with Datadog: On-Call, Incident Management and Workflow Automation
Manage incidents in Datadog: well-designed monitors, on-call with On-Call, declaring and tracking...
Alerting on error budget burn rate (multi-window burn rate)
Why alert on burn rate rather than a threshold, and how to build the multi-window, multi-burn-rat...
SLOs in Dynatrace: objectives, error budget and burn rate
SLI, SLO and SLA, error budget and burn rate: defining an availability or performance SLO in Dyna...