{"id":14972042,"url":"https://github.com/cortisolai/cortisol","last_synced_at":"2025-07-27T04:34:33.925Z","repository":{"id":189324156,"uuid":"670794721","full_name":"CortisolAI/cortisol","owner":"CortisolAI","description":"Accurately forecast log costs pre-production with Cortisol for Datadog, New Relic, Grafana and GCP Cloud Logging 💰📉","archived":false,"fork":false,"pushed_at":"2025-06-18T11:57:17.000Z","size":1751,"stargazers_count":38,"open_issues_count":6,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-18T12:50:10.743Z","etag":null,"topics":["aws-cloudwatch","cloud-cost-estimates","cost-estimates","cost-management","datadog","datadog-logs","devops","finops","gcp-logging","grafana","grafana-loki","log-analysis","log-costs","loki","metric-costs","monitoring","new-relic","new-relic-logs","observability","trace-costs"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CortisolAI.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-07-25T21:20:22.000Z","updated_at":"2025-03-12T14:47:31.000Z","dependencies_parsed_at":"2024-09-27T15:40:43.613Z","dependency_job_id":"8eb7ef34-e0a6-478e-9db0-89aeb43e129f","html_url":"https://github.com/CortisolAI/cortisol","commit_stats":{"total_commits":66,"total_committers":2,"mean_commits":33.0,"dds":0.3787878787878788,"last_synced_commit":"90cd9531bb9576f77b52764bb9fffb237ce75db2"},"previous_names":["cortisolai/cortisol"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/CortisolAI/cortisol","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CortisolAI%2Fcortisol","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CortisolAI%2Fcortisol/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CortisolAI%2Fcortisol/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CortisolAI%2Fcortisol/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CortisolAI","download_url":"https://codeload.github.com/CortisolAI/cortisol/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CortisolAI%2Fcortisol/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266005664,"owners_count":23863166,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws-cloudwatch","cloud-cost-estimates","cost-estimates","cost-management","datadog","datadog-logs","devops","finops","gcp-logging","grafana","grafana-loki","log-analysis","log-costs","loki","metric-costs","monitoring","new-relic","new-relic-logs","observability","trace-costs"],"created_at":"2024-09-24T13:46:17.085Z","updated_at":"2025-07-27T04:34:33.871Z","avatar_url":"https://github.com/CortisolAI.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Cortisol](docs/cortisol_h_large.png#gh-light-mode-only)\n![Cortisol](docs/cortisol_h_large_w.png#gh-dark-mode-only)\n\n\u003cp align=\"center\"\u003e\n    \u003cem\u003eCortisol, accurately forecast log costs pre-production.\u003c/em\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/cortisolai/cortisol/actions?query=workflow%3ACI\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://github.com/cortisolai/cortisol/workflows/CI/badge.svg\" alt=\"Test\"\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\n# cortisol\n\nCortisol is an open-source command-line tool designed specifically for web services. It offers easy-to-use cost estimation and forecasting capabilities tailored to main observability tools like [Datadog](https://www.datadoghq.com/), [New Relic](https://newrelic.com/), [Grafana](https://grafana.com/) and [GCP Cloud Logging](https://cloud.google.com/logging). Cortisol assists users in planning and optimizing their log costs before deploying their web services. It operates on a foundation inspired by [Locust](https://locust.io/), allowing users to define user behavior using a regular Python script 💰📉.\n\nFor detailed reference to Cortisol commands please go to: [Read the Docs](https://cortisolai.github.io/cortisol/)\n\n## Installation\n\n### Prerequisites\n\nCortisol requires one of the following Python versions: 3.8, 3.9, 3.10 or 3.11\n\n### Install cortisol\n\nAt the command line:\n\n    pip install cortisol\n\nIf you have an Apple M1 CPU, we suggest installing using Poetry as a dependency management. Otherwise, the underline gevent library may not work.\n\n## Getting started\n\nFirst things first! We need a RESTful service and so you'll need to do the following steps:\n\n1. Clone this example repo https://github.com/CortisolAI/getting-started-example\n2. `cd getting-started-example`\n3. `mkvirtualenv getting-started-cortisol`\n4. `python -m app.main` which will make the service available at `http://127.0.0.1:8080/`\n\nAnd, now, it's time to create your first cortisol file. Copy and paste the following in a file named `cortisolfile.py`:\n\n```python\nfrom locust import task\n\nfrom cortisol.cortisollib.users import CortisolHttpUser\n\n\nclass WebsiteUser(CortisolHttpUser):\n    @task\n    def my_task(self):\n        self.client.get(\"/\")\n\n```\n\nGo to the virtualenv where the cortisol library is installed and run the following command in the terminal. Make sure to change the base path for the `--log-file` argument:\n\n```terminal\ncortisol logs cost-estimate --host http://127.0.0.1:8080 --users 10 --spawn-rate 5 --run-time 10s --cortisol-file cortisolfile.py --log-file /some/path/getting-started-example/cortisol_app.log\n```\n\n## Commands\n\n### Log Cost Estimate\n\n#### Name\n\nForecast log costs\n\n#### Synopsis\n\n    cortisol logs cost-estimate --host HOST --log-file LOG_FILE --users NUM_USERS --spawn-rate SPAWN_RATE --run-time RUN_TIME -cortisol-file CORTISOL_PYTHON_FILE\n\n#### Description\n\nForecast log costs pre-production with Cortisol for Datadog, New Relic, and Grafana\n\n### Example\n\n    cortisol logs cost-estimate --host http://10.20.31.32:8000 --users 10 --spawn-rate 5 --run-time 10s --cortisol-file ./examples/cortisolfile.py --log-file /app/playground_app.log\n\n#### Required Flags - Option 1\n\n`-f, --cortisol-file PATH`      Path to the CORTISOL_FILE\n\n`-h, --host TEXT`               Host in the following format: http://10.20.31.32 or http://10.20.31.32:8000\n\n`-l, --log-file PATH`           Path to log file\n\n`-u, --users INTEGER`           Peak number of concurrent users\n\n`-r, --spawn-rate INTEGER`      Rate to spawn users at (users per second)\n\n`-t, --run-time TEXT`           Stop after the specified amount of time, e.g. (50, 30s, 200m, 5h, 2h30m, etc.). Default unit in seconds.\n\n#### Required Flags - Option 2\n\nAll the latter options plus the following in case your application run in a Docker container:\n\n`-c, --container-id TEXT`      Optional docker container id where your application runs\n\n##### Example\n    cortisol logs cost-estimate --host http://127.0.0.1:8080 --users 100 --spawn-rate 5 --run-time 10s --cortisol-file ./examples/cortisolfile.py --log-file /app/playground_app.log --container-id 1212aa67e530af75b3310e1e5b30261b36844a6748df1d321088c4d48a20ebd0\n\n\n#### Required Flags - Option 3\n\n`--config PATH`                 Path to config file (YAML or JSON) containing the long version of flags from option 1\n\n#### Optional Flags\n\n`--stats-file PATH`             Path where to store the cortisol statistics output as a csv\n\nHere's a YAML example:\n\n```YAML\nhost: \"http://10.20.31.32:8000\"\nlog-file: \"/path/to/logfile\"\nusers: 100\nspawn-rate: 30\nrun-time: \"20m\"\ncortisol-file: \"some_cortisol_file.py\"\nstats-file: \"cortisol_stats.csv\"\n```\n\nHere's a YAML example with docker container id:\n\n```YAML\nhost: \"http://10.20.31.32:8000\"\nlog-file: \"/path/to/logfile\"\nusers: 100\nspawn-rate: 30\nrun-time: \"20m\"\ncortisol-file: \"some_cortisol_file.py\"\ncontainer-id: \"80f1bc1e7feb\"\nstats-file: \"cortisol_stats.csv\"\n```\n\nand a JSON example:\n\n```JSON\n{\n  \"host\": \"http://10.20.31.32:8000\",\n  \"log_file\": \"/path/to/logfile\",\n  \"users\": 100,\n  \"spawn_rate\": 30,\n  \"run_time\": \"20m\",\n  \"cortisol_file\": \"some_cortisol_file.py\",\n  \"container_id\": \"80f1bc1e7feb\",\n  \"stats-file\": \"cortisol_stats.csv\"\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcortisolai%2Fcortisol","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcortisolai%2Fcortisol","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcortisolai%2Fcortisol/lists"}