49 lines
1.8 KiB
Markdown
49 lines
1.8 KiB
Markdown
# Dynatrace-SLO-Report
|
|
- Automatically generates SLO reports (Pandas/Excel) from your Dynatrace environments.
|
|
|
|
## Prerequisites
|
|
- Python 3.x (or lastest). [Download](https://www.python.org/downloads/)
|
|
- Dynatrace API Token (*Settings > Integration > Dynatrace API*)
|
|
|
|
Required python packages are documented in the requirements.txt. Run pip install to install them
|
|
pip install -r requirements.txt
|
|
|
|
## Add QM-Report flag to SLOs
|
|
|
|
Dynatrace has a limit of 25 SLOs which can be downloaded until we would need to inlcude paging - to avoid that in the meantime please add to the SLOs which are relevant for the report the "CoCo-QM-Report" as a description.
|
|
This will be used to filter the SLOs when requesting from Dynatrace
|
|
|
|

|
|
|
|
|
|
## How to use it?
|
|
1. Configure the file `config.ini`:
|
|
- [DATES]
|
|
- Specify the desired time range.
|
|
- [TENANTS]
|
|
- Specify all the tenants to extract the data from. i.e.:
|
|
```
|
|
tenant1 = https://abc12345.live.dynatrace.com <token>
|
|
#tenant2 = https://abc22345.live.dynatrace.com <token>
|
|
...
|
|
tenant3 = https://abc32345.live.dynatrace.com <token>
|
|
```
|
|
- Use comments to avoid getting the data from a specific tenant
|
|
2. `cd <python file location>`
|
|
3. Execute: ```python slo-report.py```
|
|
- Note: Make sure to have installed python packages: `pip install <package-name>`
|
|
4. Results will be stored in different folders (per enviroment) and sheets (per day).
|
|
|
|
## Monthly Reporting
|
|
1. Configure in ```python slo-report-monthly.py``` at line 69 & 80 the `hours` input variable to match with e.g. 28/29/30/31 days
|
|
|
|
```
|
|
date_report_end = date_report + datetime.timedelta(hours=744)
|
|
```
|
|
|
|
```
|
|
date_report = date_report + datetime.timedelta(hours=744)
|
|
```
|
|
|
|
2. Execute: ```python slo-report-monthly.py```
|