Go to file
Patryk Gudalewicz 6ded7c9f29 Adjusting timeframe and column spacing 2023-03-06 13:01:59 +01:00
.gitignore Implemented interaction with git (archive and shared config) 2022-07-27 22:16:32 +02:00
createDash.py Adjusting timeframe and column spacing 2023-03-06 13:01:59 +01:00
environment.yaml Added auto-deletion of unused dashboards 2022-07-26 14:41:12 +02:00
readme.md readme update 2023-03-06 12:29:54 +01:00
requirements.txt Implemented interaction with git (archive and shared config) 2022-07-27 22:13:52 +02:00

readme.md

Global Dashboard as Code

This repository holds the code to generate the Dynatrace Global Dashboard as Code.

The Global Dashboard splits in 2 different dashboards:

  • STAGING
  • PROD While the PROD dashboard is adapted manually, the Staging dashboard is auto updated when this script runs.

Dashboard Splitting

To enable flexibility for different screensizes, the script takes an -R or --ROWS parameter to define how many SLOs should be on one dedicated dashboard. If left empty, only one dashboard will be created, if entered a row the dashboard will be splitted to multiple dashboards and uploaded with the following name: [STAGING]Global Offboard Reliability 2.0 - [Business line] #1 ..#2..#3

shared configuration

This script is using the following shared configuration:

Archiving

Old artefacts (dashboard.json files) are archived within the following repository: https://atc.bmwgroup.net/bitbucket/projects/OPAPM/repos/archive/browse

Prerequisites

Python packages

Before executing scripts, python requirements have to be satisfied. To do so, execute following command: pip install -r requirements.txt

.env file

To provide authentication for API calls, create ".env" file in the script directory with following definition:

<ENV NAME>=<ENV TOKEN>
	<ENV NAME> is name of environment variable. This name should be passed to "environment.yaml" file as "env-token-name" parameter
	Example:
	environment.yaml file: "- env-token-name: "GLOBAL_CONFIG_TOKEN"
	.env file: "GLOBAL_CONFIG_TOKEN=XXXXXXXXXXX"
BITBUCKET_USERNAME=<USERNAME>
	<USERNAME> for bitbucket account with read access to shared_configuration repo and R/W access to archive repo
BITBUCKET_TOKEN=<TOKEN>
	<TOKEN> personal access token for BITBUCKET_USERNAME with repo write permissions. For more information see https://confluence.atlassian.com/bitbucketserver0717/personal-access-tokens-1087535496.html?utm_campaign=in-app-help&utm_medium=in-app-help&utm_source=stash#Personalaccesstokens-usingpersonalaccesstokens

Usage

usage: createDash.py [-h] [-R ROWS] [--auto-upload] -D DEPARTMENT

Generate and deploy the Dynatrace Global Dashboard as Code. Auto deployment works only for STAGING dashboard

options:
-h, --help            show this help message and exit
-R ROWS, --rows ROWS  Number of rows per dashboard. If not specified, all rows will be added to single dashboard (default: None)
--auto-upload         Auto upload to STAGING dashboard (default: False)
-D DEPARTMENT, --department DEPARTMENT
						Define department for which the dashboard should be updated: 'DE-3', 'DE-7', 'DE-4' or 'EC-DE' (default: None)

Files

createDash.py

This scripts generates the "tile" Section of a Dynatrace Dashboard and takes the slo_parameter.yaml as input parameter (no need to add it manually)

environment.yaml

File containing environments to execute --auto-upload

Environment name:
	name: string										#name ov environment
	env-url: str										#url of environment
	env-token-name: str								#name of environment variable containing API token

requirements.txt

File containing required python packages