Skip to main content

Grafana extension for the Chaos Toolkit Extension

Version License

Build codecov Python versions

This project should be used as a starting point to create your own Chaos Toolkit extension.

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-grafana

Usage

Sending Chaos Toolkit logs to Loki

To send the Chaos Toolkit logs to Loki endpoints, you need to enable the according control as follows:

{
    "secrets": {
        "grafana": {
            "auth": ["admin", "admin"]
        }
    },
    "controls": [
        {
            "name": "loki",
            "provider": {
                "type": "python",
                "module": "chaosgrafana.controls.loki",
                "secrets": ["grafana"],
                "arguments": {
                    "loki_endpoint": "http://localhost:3100",
                    "tags": {"service": "something"}
                }
            }
        }
    ]
}

You can set two other arguments to the control:

  • trace_id: This must be a string which will identify this run uniquely in your logs. If none is a provided, a random string is generated.
  • experiment_ref: Sometimes it's useful to identify a particular experiment, not just its run, throughout many runs. This is the string to do that. If none is provided, a hash of the experiment is performed and used. The hash is not stable across changes of the experiment of course.

These are particularly useful when you cpuple this extension with others like Prometheus where you want to cross-reference between logs and metrics.

Test

To run the tests for the project execute the following:

$ make tests

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.

Metadata

Release files for chaostoolkit-grafana 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for chaostoolkit-grafana 0.2.0
File Size Uploaded
chaostoolkit-grafana-0.2.0.tar.gz 12.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for chaostoolkit-grafana 0.2.0
File Interpreter ABI Platform
chaostoolkit_grafana-0.2.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 22.2 kB

Release files / chaostoolkit-grafana-0.2.0.tar.gz

Download URL chaostoolkit-grafana-0.2.0.tar.gz
Size 12.0 kB
Tags Source
SHA-256 checksum
How to use checksums
578ff9cfc5870cfc3dd31f5f718c4e7ba01ab695a9c259afe1e6e76ae2f0c1b5
BLAKE2b-256 checksum
How to use checksums
919d3c07ac249285a1e9b7ec38d352d942d36adcd1568a822aae5ab786bffa4a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.12

Release files / chaostoolkit_grafana-0.2.0-py2.py3-none-any.whl

Download URL chaostoolkit_grafana-0.2.0-py2.py3-none-any.whl
Size 10.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
d2242a9f01d96991f7a9d9054003d26380cad7099e9a277b5a8ed8eb5e3218a6
BLAKE2b-256 checksum
How to use checksums
96ae68886922874fd9832a9554a36e372703ba20b12d0a08280351b7e2cc9163
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.12

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page