This is an EXPERIMENTAL Dynatrace Plugin which uses the Dynatrace 3rd Party Synthetic API to add Synthetic SQL Stats and pythons APScheduler to execute the Queries.
The script can run either on a host or easily be containerized.
Get your free 15-Days Trial here: www.dynatrace.ai/nttdata
This plugin requires a MongoDB to store the JobData and JobResults
This plugin uses the pyodbc module which relies on the OS ODBC Driver for the given Databases.
On Linux (or during the creation of a docker image) run installODBCDrivers.sh to get the drivers installed for MS-SQL, MySQL, Oracle and PostgreSQL
pip install -r requirements.txt
Within the .env File adapt the variables according your needs
#GENERAL PARAMETER
SECRET=123454545452
DTURL=https://yourdtid.live.dynatrace.com
DTAPITOKEN=yourdtapitoken
PORT=5000
#MONGODB-Setting
MONGOHOST = '127.0.0.1'
MONGOUSER = 'mongoAdmin'
MONGOPASSWORD = 'mongo123'
MONGOAUTHSOURCE = 'admin'
MONGODATABASE = 'NTTD_Dynatrace_Advanced_SQL_Extension'
APSCHEDULERCOLLECTION = 'apschedulerjobs'
#ODBC Driver Names (pyodbc.driver())
MSSQL='ODBC Driver 17 for SQL Server'
POSTGRES='PostgreSQL Unicode'
MYSQL='MySQL ODBC 8.0 Unicode Driver'
ORACLE='Oracle 19 ODBC driver'
The SECRET is used to encrypt the username/passwords within the MongoDB and needs to be a 32byte base64 encoded hash
python server.py
Build the image first:
docker build -t nttdynsql .
Run the container:
docker run -dt --env-file .env -p 5000:5000 nttdynsql
docker-compose up -d
To view, add or delete jobs a simple REST API is implemented, many parts are identical to Dynatrace' 3rd Party Synthetic API and can be reused. The plugin comes with the swagger ui to look at the structure of requests goto http://yourhost:5000/api/ui/
Type: API Key
Add to: Header
Key: "AuthKey"
Value: DynatraceAPIToken
GET http://yourhost:5000/api/job
GET http://yourhost:5000/api/job/'jobid'
POST http://yourhost:5000/api/job
DELETE http://yourhost:5000/api/job/'jobid'
The plugin currently only supports one Synthetic Location
No https implemented
No change job implemented (needs to be added and deleted)