{ "info": { "author": "Google Inc.", "author_email": "brunoreboul@google.com,ocervello@google.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Build Tools" ], "description": "# SLO Generator\n\n`slo-generator` is a tool to compute **Service Level Objectives** ([SLOs](https://landing.google.com/sre/sre-book/chapters/service-level-objectives/)), **Error Budgets** and **Burn Rates**, using policies written in JSON format, and export the computation results to available\n[exporters](#exporters).\n\n## Description\n`slo-generator` will query metrics backend and compute the following metrics:\n\n* **Service Level Objective** defined as `SLO (%) = GOOD_EVENTS / VALID_EVENTS`\n* **Error Budget** defined as `ERROR_BUDGET = 100 - SLO (%)`\n* **Burn Rate** (speed at which you're burning the available error budget)\n\n#### Policies\nThe **SLO policy** (JSON) defines which metrics backend (e.g: Stackdriver), what metrics, and defines SLO targets are expected. An example is available [here](./examples/slo_linear.json).\n\nThe **Error Budget policy** (JSON) defines the window to query, the alerting\nBurn Rate Threshold, and notification settings. An example is available [here](./examples/error_budget_policy.json).\n\n#### Metrics backends\n`slo-generator` currently supports the following **metrics backends**:\n- **Stackdriver Monitoring**\n\nSupport for more backends is planned for the future (feel free to send a PR !):\n- Prometheus\n- Grafana\n- Stackdriver Logging\n- Datadog\n\n#### Exporters\n**Exporters** can be configured to send **SLO Reports** to a destination.\n\n`slo-generator` currently supports the following **exporters**:\n- **Cloud Pub/Sub** for streaming export.\n- **Stackdriver Monitoring** for exporting SLO metrics to Stackdriver Monitoring\n(e.g: Burn Rate metric, SLO/SLI metric).\n- **BigQuery** for exporting SLO report to BigQuery for deep analytics.\n\nThe exporters configuration is put in the SLO JSON config. See example in [examples/slo_linear.json](./examples/slo_linear.json).\n\n## Basic usage (local)\n\n**Requirements**\n\n* Python 3\n* gcloud SDK installed\n\n**Installation**\n\n`slo-generator` is published on PyPI. To install it, run:\n```\npip install slo-generator\n```\n\n**Write an SLO config file**\n\nSee `slo.json` files in the [`examples/`](./examples) directory to write SLO definition files.\n\n**Write an Error Budget Policy file**\n\nSee `error_budget_policy.json` files in the [`examples/`](./examples) directory to write\nError Budget Policy files.\n\n**Run the `slo-generator`**\n\n```\nslo-generator --slo-config= --error-budget-policy=\n```\n * `` is the SLO config JSON file.\n\n * `` is the Error Budget Policy JSON file.\n\nUse `slo-generator --help` to list all available arguments.\n\n## Usage in pipelines\n\nOnce the SLO measurement has been tested locally, it's a good idea to deploy a pipeline that will automatically compute SLO reports. This pipeline can be triggered on a schedule, or by specific events.\n\nA few pipeline examples are given below.\n\n### Cloud Functions\n`slo-generator` is frequently used as part of an SLO Reporting Pipeline made of:\n\n* A **Cloud Scheduler** triggering an event every X minutes.\n* A **PubSub topic**, triggered by the Cloud Scheduler event.\n* A **Cloud Function**, triggered by the PubSub topic, running `slo-generator`.\n* A **PubSub topic** to stream computation results.\n\n\nOther components can be added to make results available to other destinations:\n* A **Cloud Function** to archive SLO reports to BigQuery.\n* A **Cloud Function** to export SLO and Burn Rate metrics (e.g: to Stackdriver Monitoring)\n* A **Stackdriver Monitoring Policy** to alert on high budget Burn Rates.\n\nBelow is a diagram of what this pipeline looks like:\n\n![Architecture](./examples/terraform-google-slo/diagram.png)\n\n**Benefits:**\n\n* **Frequent SLO / Error Budget / Burn rate reporting** (max 1 every minute) with Cloud Scheduler.\n\n* **Real-time visualization** by streaming results to DataStudio.\n\n* **Historical analytics** by analyzing SLO data in Bigquery.\n\n* **Real-time alerting** by setting up Stackdriver Monitoring alerts based on\nwanted SLOs.\n\nAn example of pipeline automation with Terraform can be found in [examples/terraform-google-slo/](./examples/terraform-google-slo).\n\n### Cloud Build\n`slo-generator` can also be triggered in a Cloud Build pipeline. This can be useful if we want to compute some SLOs as part of a release process (e.g: to calculate a metric on each `git` commit or push)\n\nTo do so, you need to build an image for the `slo-generator` and push it to `Google Container Registry` in your project.\n\nTo build / push the image, run:\n\n```sh\ngcloud builds submit --config=cloudbuild.yaml . -s _PROJECT_NAME=\n```\n\nOnce the image is built, you can call the Terraform generator using the following snippet in your `cloudbuild.yaml`:\n\n```yaml\n---\nsteps:\n\n- name: gcr.io/${_PROJECT_NAME}/slo-generator\n args: ['--slo-config', '${_SLO_CONFIG_FILE}', '--error-budget-policy', '${_ERROR_BUDGET_POLICY_FILE}']\n```\n\nThen, in another repo containing your SLO definitions, simply run the pipeline, substituting the needed variables:\n\n```sh\ngcloud builds submit . --config=cloudbuild.yaml --substitutions \\\n _SLO_CONFIG_FILE= \\\n _ERROR_BUDGET_POLICY_FILE=<_ERROR_BUDGET_POLICY_FILE> \\\n _WORKSPACE=\n```\n\nIf your repo is a Cloud Source Repository, you can also configure a trigger for\nCloud Build, so that the pipeline is run automatically when a commit is made:\n\n```hcl\nresource \"google_cloudbuild_trigger\" \"dev-trigger\" {\n trigger_template {\n branch_name = \"dev\"\n repo_name = \"my-repo\"\n }\n\n substitutions = {\n _SLO_CONFIG_FILE = \"slo.json\"\n _ERROR_BUDGET_POLICY_FILE = \"error_budget_policy.json\"\n _WORKSPACE = \"dev\"\n }\n\n filename = \"cloudbuild.yaml\"\n}\n\nresource \"google_cloudbuild_trigger\" \"prod-trigger\" {\n trigger_template {\n branch_name = \"master\"\n repo_name = \"my-repo\"\n }\n\n substitutions = {\n _SLO_CONFIG_FILE = \"slo.json\"\n _ERROR_BUDGET_POLICY_FILE = \"error_budget_policy.json\"\n }\n\n filename = \"cloudbuild.yaml\"\n}\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "slo sli generator gcp", "license": "", "maintainer": "", "maintainer_email": "", "name": "slo-generator", "package_url": "https://pypi.org/project/slo-generator/", "platform": "", "project_url": "https://pypi.org/project/slo-generator/", "project_urls": null, "release_url": "https://pypi.org/project/slo-generator/0.1.6/", "requires_dist": [ "google-api-python-client", "oauth2client", "google-cloud-monitoring", "google-cloud-pubsub", "google-cloud-bigquery", "prometheus-http-client", "pyyaml", "opencensus" ], "requires_python": ">=3.0", "summary": "SLO generator", "version": "0.1.6" }, "last_serial": 5917347, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "eaec6eec303c0cf9631875be60c79330", "sha256": "b365562c9f67babba693a5c9a85d3ab0c49a18b1ddcc35fa9259e56073662609" }, "downloads": -1, "filename": "slo_generator-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "eaec6eec303c0cf9631875be60c79330", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.0", "size": 19823, "upload_time": "2019-08-30T09:40:23", "url": "https://files.pythonhosted.org/packages/bc/60/6b9dc76affaf542adf1628ba28348d13d212f23cc8a99719ed5cb0cb5e68/slo_generator-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "977304471c05be0a547d7865a676b2a0", "sha256": "f2e94f6b44e377342520a6e8243e5d31dbb6a153780bc71a29a85f95cf8d142e" }, "downloads": -1, "filename": "slo-generator-0.1.0.tar.gz", "has_sig": false, "md5_digest": "977304471c05be0a547d7865a676b2a0", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.0", "size": 14735, "upload_time": "2019-08-30T09:40:26", "url": "https://files.pythonhosted.org/packages/1e/7f/bbdbfe2b79c864b197ee39206cf4f2d3f2e271c21b033a1a28a513cd8c7f/slo-generator-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "5317ef560c32ae677961c833dc2e539f", "sha256": "a2c7bcd6db2f41deb35f6cdcc15496f3a61a6c0c38803309704dc83e93380d86" }, "downloads": -1, "filename": "slo_generator-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "5317ef560c32ae677961c833dc2e539f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.0", "size": 19828, "upload_time": "2019-09-04T13:47:21", "url": "https://files.pythonhosted.org/packages/cc/af/c4c729fbadeb781b9f02ee6c3f1dd7e83435d654919ef43ba3716c40868f/slo_generator-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f2178585b9c499f32906b6a013327024", "sha256": "a6ed57bfb82a5da8d0165dabea13a43e31ff9f7c2ff331390b4f1bca7578032c" }, "downloads": -1, "filename": "slo-generator-0.1.1.tar.gz", "has_sig": false, "md5_digest": "f2178585b9c499f32906b6a013327024", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.0", "size": 14799, "upload_time": "2019-09-04T13:47:23", "url": "https://files.pythonhosted.org/packages/15/15/eb1db9bfa3bc5db7572111d84e2c3202f451c65e3fca73ff36dab197377b/slo-generator-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "50957136a104e695508fc7858e37b052", "sha256": "80dddb2b82941db530d173fcc0d14401785fbe8d0df8049cac1ace464f7ae09c" }, "downloads": -1, "filename": "slo_generator-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "50957136a104e695508fc7858e37b052", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.0", "size": 20007, "upload_time": "2019-09-06T17:20:31", "url": "https://files.pythonhosted.org/packages/a5/98/cfce6b02f5ed8cd50e9f4d53693d83ebba09c11a0f9f2e86cde05923e7d8/slo_generator-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8f747a1dfbf1c5d1d20d6e0cfd3d332b", "sha256": "7782090e5cc3b1eb676d2374a4dd884688d7a3489d1219760a76456ca79779b7" }, "downloads": -1, "filename": "slo-generator-0.1.2.tar.gz", "has_sig": false, "md5_digest": "8f747a1dfbf1c5d1d20d6e0cfd3d332b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.0", "size": 14921, "upload_time": "2019-09-06T17:20:33", "url": "https://files.pythonhosted.org/packages/68/5d/32080c380960e6c1f1e47344ee4ff6860349d9dfb89824816bc4850bbd21/slo-generator-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "8b4c4f6750ba3079f0e46298c8787197", "sha256": "4031c6a86754bee39be3351049c3b3ccdecc9d0d56795b1eedeb1ec709cd4a6d" }, "downloads": -1, "filename": "slo_generator-0.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "8b4c4f6750ba3079f0e46298c8787197", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.0", "size": 20014, "upload_time": "2019-09-09T07:43:08", "url": "https://files.pythonhosted.org/packages/95/c9/7d35ae8073d9ecea591b1637493484151b708f1fbdac9a4ece8b6a34fcf4/slo_generator-0.1.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "148848c8e45c767d5f9ecc7f17ee3e07", "sha256": "f1e765f5e4ccf9230b033de7c8f0bba741faa120c6e2a7adc30401dbadb63f95" }, "downloads": -1, "filename": "slo-generator-0.1.3.tar.gz", "has_sig": false, "md5_digest": "148848c8e45c767d5f9ecc7f17ee3e07", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.0", "size": 14921, "upload_time": "2019-09-09T07:43:10", "url": "https://files.pythonhosted.org/packages/c5/28/2809d4e8a01967314f9683d28e1ec149d10ccc73cc8357738e26db06e5e0/slo-generator-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "f26befa306df6c7a4d2fa87c42379a43", "sha256": "feb469b41e0be1175ffff7aa48ab581e2a460588be67a2d51b4e941da8a4964f" }, "downloads": -1, "filename": "slo_generator-0.1.4-py3-none-any.whl", "has_sig": false, "md5_digest": "f26befa306df6c7a4d2fa87c42379a43", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.0", "size": 20091, "upload_time": "2019-09-10T13:53:52", "url": "https://files.pythonhosted.org/packages/d2/d3/9e174c07d5f47606544dc61003b4b7f4b6f1d7489fc67ff2cef8e5db524c/slo_generator-0.1.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "64e47c33d16383d9cef0dbbab8263a87", "sha256": "f117b2c7c3e8e817d92d875ffe9345ca27a3210432f098870c5435e24501a23a" }, "downloads": -1, "filename": "slo-generator-0.1.4.tar.gz", "has_sig": false, "md5_digest": "64e47c33d16383d9cef0dbbab8263a87", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.0", "size": 15005, "upload_time": "2019-09-10T13:53:54", "url": "https://files.pythonhosted.org/packages/26/eb/9a375a6e9f04855239b45b4d251376c261538490b0c1ba52fc833fe455b8/slo-generator-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "c2555d7f0b62d2642a8315fa94169759", "sha256": "5549ad3df54565dd1db50bfaa605f643ea5cbc7be310650bfd5a288ce7688923" }, "downloads": -1, "filename": "slo_generator-0.1.5-py3-none-any.whl", "has_sig": false, "md5_digest": "c2555d7f0b62d2642a8315fa94169759", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.0", "size": 20429, "upload_time": "2019-09-22T11:09:23", "url": "https://files.pythonhosted.org/packages/fb/bb/088ec365aeab07da4ea48d35a262da12edfbb3d0627c6ac9bb30028e9b08/slo_generator-0.1.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a3ea7686ac4a9f09093ef79fcbee3366", "sha256": "2d46c30a6409561e96f251acc645f40b7c094efd3d89f10b37cfbf3cc80f2257" }, "downloads": -1, "filename": "slo-generator-0.1.5.tar.gz", "has_sig": false, "md5_digest": "a3ea7686ac4a9f09093ef79fcbee3366", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.0", "size": 15770, "upload_time": "2019-09-22T11:09:25", "url": "https://files.pythonhosted.org/packages/b9/0b/e8b97a2fc6545ef577de85bda1ff25d72a99550c6b53db1331a38de7e9a4/slo-generator-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "1d7df627bb7d3b56e8f577e38160def6", "sha256": "b713fb8b7fc8991d0cb47c15e80ab451f73247a296183494c90961f74c7d96c0" }, "downloads": -1, "filename": "slo_generator-0.1.6-py3-none-any.whl", "has_sig": false, "md5_digest": "1d7df627bb7d3b56e8f577e38160def6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.0", "size": 21939, "upload_time": "2019-10-02T11:19:32", "url": "https://files.pythonhosted.org/packages/b5/e6/f7e0916737fc7396fd4aeea451dfe00f9c95e4ea7b79d7f311cbd128743f/slo_generator-0.1.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "867e34354a7e9c4fa4a0d77f8864060a", "sha256": "9c454f8d80a5f799e92cdb658cc306f380c175efb659997239a242053ce755b5" }, "downloads": -1, "filename": "slo-generator-0.1.6.tar.gz", "has_sig": false, "md5_digest": "867e34354a7e9c4fa4a0d77f8864060a", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.0", "size": 15731, "upload_time": "2019-10-02T11:19:35", "url": "https://files.pythonhosted.org/packages/12/3c/e7856f1cb2c8e375c2b527d805c2235442be126d2819782702f5d6c43ef4/slo-generator-0.1.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1d7df627bb7d3b56e8f577e38160def6", "sha256": "b713fb8b7fc8991d0cb47c15e80ab451f73247a296183494c90961f74c7d96c0" }, "downloads": -1, "filename": "slo_generator-0.1.6-py3-none-any.whl", "has_sig": false, "md5_digest": "1d7df627bb7d3b56e8f577e38160def6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.0", "size": 21939, "upload_time": "2019-10-02T11:19:32", "url": "https://files.pythonhosted.org/packages/b5/e6/f7e0916737fc7396fd4aeea451dfe00f9c95e4ea7b79d7f311cbd128743f/slo_generator-0.1.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "867e34354a7e9c4fa4a0d77f8864060a", "sha256": "9c454f8d80a5f799e92cdb658cc306f380c175efb659997239a242053ce755b5" }, "downloads": -1, "filename": "slo-generator-0.1.6.tar.gz", "has_sig": false, "md5_digest": "867e34354a7e9c4fa4a0d77f8864060a", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.0", "size": 15731, "upload_time": "2019-10-02T11:19:35", "url": "https://files.pythonhosted.org/packages/12/3c/e7856f1cb2c8e375c2b527d805c2235442be126d2819782702f5d6c43ef4/slo-generator-0.1.6.tar.gz" } ] }