{"id":21303993,"url":"https://github.com/adinhodovic/opencost-mixin","last_synced_at":"2025-04-09T22:42:15.367Z","repository":{"id":262166761,"uuid":"882785143","full_name":"adinhodovic/opencost-mixin","owner":"adinhodovic","description":"Monitoring mixin for Kubernetes cost monitoring. A set of Grafana dashboards and Prometheus rules for OpenCost.","archived":false,"fork":false,"pushed_at":"2025-02-14T16:08:25.000Z","size":146,"stargazers_count":9,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-24T00:38:53.525Z","etag":null,"topics":["cost-optimization","grafana-dashboard","kubernetes","kubernetes-mixins","kubernetes-monitoring","mixins","opencost","prometheus"],"latest_commit_sha":null,"homepage":"","language":"Jsonnet","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/adinhodovic.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-03T18:49:35.000Z","updated_at":"2025-02-27T14:14:51.000Z","dependencies_parsed_at":"2024-11-11T00:21:59.025Z","dependency_job_id":"ddf538f8-0beb-4b5a-b43f-d5350df2d243","html_url":"https://github.com/adinhodovic/opencost-mixin","commit_stats":null,"previous_names":["adinhodovic/opencost-mixin"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adinhodovic%2Fopencost-mixin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adinhodovic%2Fopencost-mixin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adinhodovic%2Fopencost-mixin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adinhodovic%2Fopencost-mixin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adinhodovic","download_url":"https://codeload.github.com/adinhodovic/opencost-mixin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248124859,"owners_count":21051757,"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","grafana-dashboard","kubernetes","kubernetes-mixins","kubernetes-monitoring","mixins","opencost","prometheus"],"created_at":"2024-11-21T16:01:06.406Z","updated_at":"2025-04-09T22:42:15.327Z","avatar_url":"https://github.com/adinhodovic.png","language":"Jsonnet","funding_links":[],"categories":["kubernetes"],"sub_categories":[],"readme":"# Prometheus Monitoring Mixin for OpenCost\n\nA set of Grafana dashboards and Prometheus alerts for OpenCost.\n\n## How to use\n\nThis mixin is designed to be vendored into the repo with your infrastructure config.\nTo do this, use [jsonnet-bundler](https://github.com/jsonnet-bundler/jsonnet-bundler):\n\nYou then have three options for deploying your dashboards\n\n1. Generate the config files and deploy them yourself\n2. Use jsonnet to deploy this mixin along with Prometheus and Grafana\n3. Use prometheus-operator to deploy this mixin\n\nOr import the dashboard using json in `./dashboards_out`, alternatively import them from the `Grafana.com` dashboard page.\n\n## Generate config files\n\nYou can manually generate the alerts, dashboards and rules files, but first you\nmust install some tools:\n\n```sh\ngo get github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb\nbrew install jsonnet\n```\n\nThen, grab the mixin and its dependencies:\n\n```sh\ngit clone https://github.com/adinhodovic/opencost-mixin\ncd opencost\njb install\n```\n\nFinally, build the mixin:\n\n```sh\nmake prometheus_alerts.yaml\nmake dashboards_out\n```\n\nThe `prometheus_alerts.yaml` file then need to passed\nto your Prometheus server, and the files in `dashboards_out` need to be imported\ninto you Grafana server. The exact details will depending on how you deploy your\nmonitoring stack.\n\n### Configuration\n\nThis mixin has its configuration in the `config.libsonnet` file. You can disable the alerts for cost alerts and anomalies by setting the `enabled` field to `false`.\n\n```jsonnet\n{\n  _config+:: {\n    alerts: {\n      budget: {\n        // Alerts if the cost is 200 USD (example).\n        // You need to configure this alert.\n        enabled: true,\n        monthlyCostThreshold: 200,\n      },\n      anomaly: {\n        // Alerts if the cost spiked by 20% or more\n        enabled: true,\n        anomalyPercentageThreshold: 20,\n      },\n    },\n  },\n}\n```\n\nThe mixin has all components enabled by default and all the dashboards are generated in the `dashboards_out` directory. You can import them into Grafana.\n\n## Alerts\n\nThe mixin follows the [monitoring-mixins guidelines](https://github.com/monitoring-mixins/docs#guidelines-for-alert-names-labels-and-annotations) for alerts.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadinhodovic%2Fopencost-mixin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadinhodovic%2Fopencost-mixin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadinhodovic%2Fopencost-mixin/lists"}