Skip to content

Automation of synthetic monitors used for dynatrace monitoring

License

Notifications You must be signed in to change notification settings

hmcts/dynatrace-availability-dashboards

Repository files navigation

Dynatrace Availability Dashboards

Purpose

The purpose of this repository is to automate the creation of Synthetic Monitors, Management Zones, SLOS and Dashboards within Dynatrace, by querying Ingress objects in each environment on the CFT Kubernetes clusters

What's inside?

  • Terraform
    Components defined in Terraform to build associated infrastructure
  • Python and Bash scripts
    These scripts are used to:
    • Autogenerate yaml files per-environment based on Ingress objects withiin clusters, to update Terraform configuration files
    • Create Pull Requests if there are changes to Ingress objects within clusters
  • Azure pipelines
    • Daily - Runs each morning at 7AM to fetch latest changes
    • Deployment - Deploy infrastructure changes and update dahsboards
  • Github Actions
    We use Github Actions to run:
  • Renovate
    Renovate is configured to keep our dependencies up-to-date and keep a running dashboard

Terraform docs

Requirements

Name Version
terraform 1.4.0
dynatrace 1.21.0

Providers

Name Version
dynatrace 1.21.0
time n/a

Resources

Name Type
dynatrace_dashboard.availability resource
dynatrace_http_monitor.availability resource
dynatrace_maintenance.auto_shutdown_blackout resource
dynatrace_maintenance.auto_shutdown_weekends resource
dynatrace_maintenance.planned_blackout resource
dynatrace_management_zone.availability resource
dynatrace_slo.availability resource
time_sleep.management_zones resource

Inputs

Name Description Type Default Required
auto_window_end_date This is the date that the cluster-shutdown maintenance window (stopped alerting) should end string "2030-01-01" no
auto_window_end_time This is the time that the cluster-shutdown maintenance window (stopped alerting) should end string "08:30:00" no
auto_window_start_date This is the date that the cluster-shutdown maintenance window (stopped alerting) should begin string "2023-01-31" no
auto_window_start_time This is the time that the cluster-shutdown maintenance window (stopped alerting) should begin string "20:00:00" no
automated_weekday_maintenance This is a toggle to enable or disable the automatic maintenance window for an environment on weekdays, defaults to true as we have cluster shutdowns. bool true no
automated_weekend_maintenance This is a toggle to enable or disable the automatic maintenance window for an environment on the weekend, defaults to true as we have cluster shutdowns. bool true no
builtFrom builtFrom variable required by cnp terraform template. Not in use by terraform string null no
dt_env_url Dynatrace environment URL string n/a yes
dynatrace_platops_api_key Dynatrace API access key string n/a yes
env Name of the environment to build in string n/a yes
planned_maintenance This is a toggle to enable or disable a planned maintenance window for an environment bool false no
planned_window_end_time End time of the planned maintenance window string "2023-01-30T20:00:00" no
planned_window_start_time Start time of the planned maintenance window string "2023-01-30T19:00:00" no
product product variable required by cnp terraform template. Not in use by terraform string null no
weekend_window_end_time This is the time that the cluster-shutdown maintenance window (stopped alerting) should end during the weekend string "23:59:59" no
weekend_window_start_time This is the time that the cluster-shutdown maintenance window (stopped alerting) should begin during the weekend string "00:00:00" no

Outputs

Name Description
ado_dashboard_url Used to display created dashboard URLs as vso[task.logissue type=warning]
dashboard_url Dynatrace Dashboard URL

Blackouts (Maintenance Windows)

There are two types of Maintenance Windows being handled by this repository:

  • Automated
    • Created here and used to turn off our HTTP monitors and alerting for the nonprod environments that are shut down during the evenings, and restarted in the morning. To change the settings for a specific environment, edit the {env}.tfvars file.
  • Manual
    • Created here and should be enabled in a case where we have a planned suspected outage for one or more environments, i.e a cluster switchover. To achieve this:
      • Set the enabled flag to true in a given {env}.tfvars file, for example in demo
      • Update the variables defined a given {env}.tfvars file file. This allows you to define the start, and end time of the planned outage within that environment.

About

Automation of synthetic monitors used for dynatrace monitoring

Topics

Resources

License

Stars

Watchers

Forks