All Projects → chaostoolkit-incubator → chaostoolkit-prometheus

chaostoolkit-incubator / chaostoolkit-prometheus

Licence: Apache-2.0 License
Prometheus Extension for the Chaos Toolkit

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to chaostoolkit-prometheus

chaos-exporter
Prometheus Exporter for Litmus Chaos Metrics
Stars: ✭ 25 (+92.31%)
Mutual labels:  prometheus, chaos-engineering
chaostoolkit-spring
Spring Chaos Monkey driver for the Chaos Toolkit
Stars: ✭ 12 (-7.69%)
Mutual labels:  chaos-engineering, chaostoolkit-extension
monarch
App-level Chaos Engineering
Stars: ✭ 26 (+100%)
Mutual labels:  chaos-engineering, chaostoolkit-extension
chaostoolkit-azure
Chaos Toolkit Extension for Azure
Stars: ✭ 21 (+61.54%)
Mutual labels:  chaos-engineering, chaostoolkit-extension
jail exporter
A Prometheus exporter for FreeBSD jail metrics
Stars: ✭ 21 (+61.54%)
Mutual labels:  prometheus
python-monitoring-talk
Materials for my talks and articles on monitoring with focus on Python applications
Stars: ✭ 32 (+146.15%)
Mutual labels:  prometheus
sentry exporter
Prometheus exporter for Sentry
Stars: ✭ 23 (+76.92%)
Mutual labels:  prometheus
octane-exporter
Export Laravel Octane metrics using this Prometheus exporter.
Stars: ✭ 14 (+7.69%)
Mutual labels:  prometheus
aws-ec2-sg-exporter
A dockerized Prometheus exporter that compares desired/wanted IPv4/IPv6 CIDR against currently applied inbound CIDR rules in your security group(s).
Stars: ✭ 23 (+76.92%)
Mutual labels:  prometheus
prometheus-mysql-exporter
Prometheus MySQL Exporter
Stars: ✭ 33 (+153.85%)
Mutual labels:  prometheus
v1-litmus-docs
Documentation for the Litmus Project
Stars: ✭ 19 (+46.15%)
Mutual labels:  chaos-engineering
microservices-observability
🎉 Microservices Observability - Log Aggregation, Distributed Tracking, Metrics
Stars: ✭ 40 (+207.69%)
Mutual labels:  prometheus
selectel-exporter
No description or website provided.
Stars: ✭ 25 (+92.31%)
Mutual labels:  prometheus
website
Prometheus monitoring mixins
Stars: ✭ 91 (+600%)
Mutual labels:  prometheus
java-metrics
No description or website provided.
Stars: ✭ 31 (+138.46%)
Mutual labels:  prometheus
epiphany
Cloud and on-premises automation for Kubernetes centered industrial grade solutions.
Stars: ✭ 114 (+776.92%)
Mutual labels:  prometheus
cdn-up-and-running
CDN Up and Running - an introduction about how modern CDNs works
Stars: ✭ 131 (+907.69%)
Mutual labels:  prometheus
observatory-exporter
Prometheus exporter for Mozilla Observatory
Stars: ✭ 31 (+138.46%)
Mutual labels:  prometheus
eks-hpa-profile
An eksctl gitops profile for autoscaling with Prometheus metrics on Amazon EKS on AWS Fargate
Stars: ✭ 26 (+100%)
Mutual labels:  prometheus
alertmanager-irc-relay
Send Prometheus Alerts to IRC using Webhooks
Stars: ✭ 44 (+238.46%)
Mutual labels:  prometheus

Prometheus extension for the Chaos Toolkit

Version License

Build codecov Python versions

Prometheus support for the Chaos Toolkit.

Install

To be used from your experiment, this package must be installed in the Python environment where chaostoolkit already lives.

$ pip install chaostoolkit-prometheus

Usage

To use this package, you must create have access to a Prometheus instance via HTTP and be allowed to connect to it.

This package only exports probes to query for some aspects of your system as monitored by Prometheus.

Here is an example of querying Prometheus at a given moment

{
    "type": "probe",
    "name": "fetch-cpu-just-2mn-ago",
    "provider": {
        "type": "python",
        "module": "chaosprometheus.probes",
        "func": "query",
        "arguments": {
            "query": "process_cpu_seconds_total{job='websvc'}",
            "when": "2 minutes ago"
        }
    }
}

You can also ask for an interval as follows:

{
    "type": "probe",
    "name": "fetch-cpu-over-interval",
    "provider": {
        "type": "python",
        "module": "chaosprometheus.probes",
        "func": "query_interval",
        "arguments": {
            "query": "process_cpu_seconds_total{job='websvc'}",
            "start": "2 minutes ago",
            "end": "now",
            "step": 5
        }
    }
}

In both cases, the probe returns the JSON payload as-is from Prometheus or raises an exception when an error is met.

The result is not further process and should be found in the generated report of the experiment run.

You can also send metrics to a pushgateway service via a control:

{
    "controls": [
        {
            "name": "prometheus",
            "provider": {
                "type": "python",
                "module": "chaosprometheus.metrics",
                "arguments": {
                    "pushgateway_url": "http://someip:9091",
                    "job": "chaostoolkit"
                }
            }
        }
    ]
}

You can also set three more arguments:

  • grouping_key: A mapping of strings to uniquely aggregate multiple runs in the Prometheus backend
  • trace_id: This must be a string which will identify this run uniquely in your metrics. 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 couple this extension with others like Loki where you want to cross-reference between logs and metrics.

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].