{"id":19518258,"url":"https://github.com/tetratelabs/istio-cost-analyzer","last_synced_at":"2025-04-26T07:30:39.999Z","repository":{"id":37938276,"uuid":"472159800","full_name":"tetratelabs/istio-cost-analyzer","owner":"tetratelabs","description":"Cluster Egress Cost Analysis","archived":false,"fork":false,"pushed_at":"2023-06-20T15:54:05.000Z","size":79825,"stargazers_count":13,"open_issues_count":9,"forks_count":2,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-04T09:12:00.615Z","etag":null,"topics":["cost-optimization","istio","kubernetes","prometheus"],"latest_commit_sha":null,"homepage":"","language":"Go","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/tetratelabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-03-21T02:23:50.000Z","updated_at":"2024-11-21T06:15:38.000Z","dependencies_parsed_at":"2024-01-16T18:57:55.435Z","dependency_job_id":"73b12697-252b-463f-9dae-c32d062dfa8f","html_url":"https://github.com/tetratelabs/istio-cost-analyzer","commit_stats":{"total_commits":99,"total_committers":2,"mean_commits":49.5,"dds":0.04040404040404044,"last_synced_commit":"b9135a1c6a13c9808a7e195d8781bb1558d87b24"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetratelabs%2Fistio-cost-analyzer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetratelabs%2Fistio-cost-analyzer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetratelabs%2Fistio-cost-analyzer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetratelabs%2Fistio-cost-analyzer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tetratelabs","download_url":"https://codeload.github.com/tetratelabs/istio-cost-analyzer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250953091,"owners_count":21513249,"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":["cost-optimization","istio","kubernetes","prometheus"],"created_at":"2024-11-11T00:10:16.856Z","updated_at":"2025-04-26T07:30:39.665Z","avatar_url":"https://github.com/tetratelabs.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Istio Cost Analyzer\n\nThe Istio Cost Analyzer is a tool that allows you to analyze the costliest workload links in your cluster. It relies on Kubernetes/Istio and Prometheus to gather\ndata, and uses publicly-available cloud egress rates to estimate the overall egress costs of your services.\n\n## Usage\n\nTo use this on your kubernetes cluster, make sure you have a kubeconfig in your home directory, and make sure Istio is installed on your cluster, with the prometheus addon enabled. You must also have a `HEALTHY` Istio Operator available.\n\n\n### Installation\n\nTo install the `istio-cost-analyzer` binary:\n\n```shell\ngo install github.com/tetratelabs/istio-cost-analyzer@latest\n```\n\n### Setup\n\nThe setup command does a few things:\n- Edits Istio Operator config to add custom prometheus metrics (a `destination_locality` label on an Istio metric).\n- Creates a Mutating Webhook that gets called when a new deployment is created. This mutating webhook runs in a pod and has associated RBAC permissions, Services, etc.\n- Labels existing pods \u0026 deployments in said `--targetNamespace`.\n\nYou can either run the following command and have a webhook handle everything all existing Deployments and all Deployments created in the future:\n\n```\nistio-cost-analyzer setup\n```\n\n| Flag              |                                                      Description                                                      |           Default Value |\n|:------------------|:---------------------------------------------------------------------------------------------------------------------:|------------------------:|\n| targetNamespace   |                                 Namespace which the cost analyzer will watch/analyze                                  |               `default` |\n| analyzeAll (`-a`) | Adding this flag will cause the cost analyzer to analyze all namespaces. Don't set this if you set `targetNamespace`. |                 `false` |\n| cloud             |          Cloud on which your cluster is running (node info varies cloud to cloud -- inferred from Node info)          | Inferred from Node info |\n| analyzerNamespace |                Namespace in which cost analyzer config will exist (you usually don't need to set this)                |          `istio-system` |\n\n\n## Running\n\nRun:\n\n```\nistio-cost-analyzer analyze\n```\n\n| Flag                |                                                                                  Description                                                                                  |            Default Value |\n|:--------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|-------------------------:|\n| cloud               | Cloud on which your cluster is running (node info varies cloud to cloud). Options are `gcp` or `aws`. If you are on GCP or AWS, you don't need to set this as it is inferred. |  Inferred from Node info |\n| prometheusNamespace |                                               Namespace in which the prometheus pod exists (you usually don't need to set this)                                               |           `istio-system` |\n| pricePath           |        For non-standard aws/gcp rates (on-prem, negotiated rates). If you set this, you don't need to set `cloud`. See `/pricing` (you usually don't need to set this)        |                     None |\n| details             |                                     Extended table view that shows both destination and source workload/locality, instead of just source.                                     |                  `false` |\n| start               |                                                    RFC3999 UTC timestamp that indicates from when to start analyzing data.                                                    |            0 (beginning) |\n| end                 |                                                     RFC3999 UTC timestamp that indicates to when to stop analyzing data.                                                      |             `time.Now()` |\n\n\nThe output should look like (without `--details`): \n\n```\nTotal: \u003c$0.01\n\nSOURCE WORKLOAD\tSOURCE LOCALITY\tCOST   \nproductpage-v1 \tus-west1-b     \t\u003c$0.01\t\nreviews-v2     \tus-west1-b     \t-     \t\nreviews-v3     \tus-west1-b     \t-  \n```\nWith `--details`:\n\n```\nTotal: \u003c$0.01\n\nSOURCE WORKLOAD\tSOURCE LOCALITY\tDESTINATION WORKLOAD\tDESTINATION LOCALITY\tTRANSFERRED (MB)\tCOST   \nproductpage-v1 \tus-west1-b     \tdetails-v1          \tus-west1-c          \t0.173250        \t\u003c$0.01\t\nproductpage-v1 \tus-west1-b     \treviews-v1          \tus-west1-b          \t0.058500        \t-     \t\nproductpage-v1 \tus-west1-b     \treviews-v2          \tus-west1-b          \t0.056250        \t-     \t\nproductpage-v1 \tus-west1-b     \treviews-v3          \tus-west1-b          \t0.058500        \t-     \t\nreviews-v2     \tus-west1-b     \tratings-v1          \tus-west1-b          \t0.056150        \t-     \t\nreviews-v3     \tus-west1-b     \tratings-v1          \tus-west1-b          \t0.058400        \t-    \n```\n\n### Cleanup\n\nIf you want to restart installation of the tool or don't want it in your cluster anymore, you can run:\n    \n```\nistio-cost-analyzer destroy\n```\n\nYou must set the `--analyzerNamespace` flag if you set it in the `setup` command.\n\nYou must also edit your Istio Operator config to remove the custom prometheus metrics. (you can use `-o` to do that here, but it's unstable)\n\n\n\n\n- add for latency:","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftetratelabs%2Fistio-cost-analyzer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftetratelabs%2Fistio-cost-analyzer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftetratelabs%2Fistio-cost-analyzer/lists"}