Chaos Toolkit extension for DataDog
Project description
Chaos Toolkit Extension Template
This project contains Chaos Toolkit activities and tolerances to work with DataDog.
Install
This package requires Python 3.7+
To be used from your experiment, this package must be installed in the Python environment where chaostoolkit already lives.
$ pip install chaostoolkit-datadog
Usage
A typical experiment using this extension would look like this:
{
"version": "1.0.0",
"title": "Run a, experiment using a DataDog SLO to verify our system",
"description": "n/a",
"configuration": {
"datadog_host": "https://datadoghq.eu"
},
"steady-state-hypothesis": {
"title": "n/a",
"probes": [
{
"type": "probe",
"name": "read-slo",
"tolerance": {
"type": "probe",
"name": "check-slo",
"provider": {
"type": "python",
"module": "chaosdatadog.slo.tolerances",
"func": "slo_must_be_met",
"arguments": {
"threshold": "7d"
}
}
},
"provider": {
"type": "python",
"module": "chaosdatadog.slo.probes",
"func": "get_slo",
"arguments": {
"slo_id": "..."
}
}
}
]
},
"method": []
}
That's it!
Please explore the code to see existing probes and actions.
Configuration
In the configuration
block you may want to specify the DataDog host you are
targetting:
"configuration": {
"datadog_host": "https://datadoghq.eu"
},
The authentication can be set using the typical DataDog environment variables, notably:
DD_API_KEY
: the API keyDD_APP_KEY
: the application key
Test
To run the tests for the project execute the following:
$ pytest
Formatting and Linting
We use a combination of black
, flake8
, and isort
to both lint and format this repositories code.
Before raising a Pull Request, we recommend you run formatting against your code with:
$ make format
This will automatically format any code that doesn't adhere to the formatting standards.
As some things are not picked up by the formatting, we also recommend you run:
$ make lint
To ensure that any unused import statements/strings that are too long, etc. are also picked up.
Contribute
If you wish to contribute more functions to this package, you are more than welcome to do so. Please, fork this project, make your changes following the usual PEP 8 code style, sprinkling with tests and submit a PR for review.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for chaostoolkit-datadog-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44acfe630bffc7a2df8962d8e0b1810935d6350f0d3f8c4c26259dd665d3ee0e |
|
MD5 | 5ca7d8be79c20f859917d066d03e5d1c |
|
BLAKE2b-256 | 78b382949d1f890406823a67a4f9c567f8b4b82bb2a42f7d189abb5a2e6cac58 |
Hashes for chaostoolkit_datadog-0.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6feb25829f57efe236ac7bcb0fc81003635dc6856ac34c753c35c5576c72256e |
|
MD5 | e2ab0ab34b3e4dfb2141dbe359ad4735 |
|
BLAKE2b-256 | 6185809ad8adeccac7fe1e49f9b30b19675e5079a1cac3c861e87c76bd527e03 |