{"id":17993935,"url":"https://github.com/jimeh/macos-battery-exporter","last_synced_at":"2026-05-05T07:31:53.213Z","repository":{"id":212743852,"uuid":"732209492","full_name":"jimeh/macos-battery-exporter","owner":"jimeh","description":"Prometheus exporter for detailed battery metrics on macOS.","archived":false,"fork":false,"pushed_at":"2023-12-21T00:26:46.000Z","size":45,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-25T13:56:48.297Z","etag":null,"topics":["battery","battery-info","battery-monitor","battery-status","macos","prometheus","prometheus-exporter"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jimeh.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2023-12-15T23:37:18.000Z","updated_at":"2025-02-04T16:11:47.000Z","dependencies_parsed_at":"2023-12-21T01:37:57.210Z","dependency_job_id":null,"html_url":"https://github.com/jimeh/macos-battery-exporter","commit_stats":{"total_commits":29,"total_committers":2,"mean_commits":14.5,"dds":0.2068965517241379,"last_synced_commit":"67890d936c8b4f7d54b12398527bc206f789b16b"},"previous_names":["jimeh/macos-battery-exporter"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/jimeh/macos-battery-exporter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimeh%2Fmacos-battery-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimeh%2Fmacos-battery-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimeh%2Fmacos-battery-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimeh%2Fmacos-battery-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jimeh","download_url":"https://codeload.github.com/jimeh/macos-battery-exporter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jimeh%2Fmacos-battery-exporter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32640533,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-04T10:08:07.713Z","status":"online","status_checked_at":"2026-05-05T02:00:06.033Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["battery","battery-info","battery-monitor","battery-status","macos","prometheus","prometheus-exporter"],"created_at":"2024-10-29T20:13:30.969Z","updated_at":"2026-05-05T07:31:53.197Z","avatar_url":"https://github.com/jimeh.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  macos-battery-exporter\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003e\n    Prometheus exporter for detailed battery metrics on macOS.\n  \u003c/strong\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/jimeh/macos-battery-exporter/releases\"\u003e\u003cimg src=\"https://img.shields.io/github/v/tag/jimeh/macos-battery-exporter?label=release\" alt=\"GitHub tag (latest SemVer)\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://pkg.go.dev/github.com/jimeh/macos-battery-exporter\"\u003e\u003cimg src=\"https://img.shields.io/badge/%E2%80%8B-reference-387b97.svg?logo=go\u0026logoColor=white\" alt=\"Go Reference\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/jimeh/macos-battery-exporter/issues\"\u003e\u003cimg src=\"https://img.shields.io/github/issues-raw/jimeh/macos-battery-exporter.svg?style=flat\u0026logo=github\u0026logoColor=white\" alt=\"GitHub issues\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/jimeh/macos-battery-exporter/pulls\"\u003e\u003cimg src=\"https://img.shields.io/github/issues-pr-raw/jimeh/macos-battery-exporter.svg?style=flat\u0026logo=github\u0026logoColor=white\" alt=\"GitHub pull requests\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/jimeh/macos-battery-exporter/blob/main/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/jimeh/macos-battery-exporter.svg?style=flat\" alt=\"License Status\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nA Prometheus exporter for macOS battery information, exposing wide range of\ndetails available from `ioreg` about batteries. Includes a lot more details than\nwhat `node_exporter` supports via its `node_power_supply_*` metrics.\n\n## Installation\n\n### Manually\n\nBinary releases are available on the\n[Releases](https://github.com/jimeh/macos-battery-exporter/releases) page.\n\n### Homebrew\n\nYou can install it from the [`jimeh/tap`](https://github.com/jimeh/homebrew-tap)\nTap:\n\n```bash\nbrew install jimeh/tap/macos-battery-exporter\n```\n\n#### Service\n\nThe homebrew formula has a service configuration, which can be started with:\n\n```bash\nbrew services start macos-battery-exporter\n```\n\nAfter which battery metrics are available on\n[`http://localhost:9108/metrics`](http://localhost:9108/metrics).\n\n### Go\n\n```bash\ngo install github.com/jimeh/macos-battery-exporter@latest\n```\n\n## Usage\n\n### Help\n\n```bash\nmacos-battery-exporter -h\n```\n\n```\nusage: macos-battery-exporter [\u003coptions\u003e]\n\n  -b string\n    \tBind address to run server on (default \"127.0.0.1\")\n  -d string\n    \tLog output device (stderr or stdout) (default \"stderr\")\n  -l string\n    \tLog level (default \"info\")\n  -n string\n    \tNamespace for metrics (default \"macos\")\n  -o string\n    \tOutput file to write to in Prometheus format\n  -p int\n    \tPort to run server on (default 9108)\n  -s\tRun as a Prometheus metrics server\n  -v\tPrint version and exit\n```\n\n### Print to STDOUT\n\n```bash\nmacos-battery-exporter\n```\n\n```ini\n# HELP macos_battery_cell_disconnect_count Total number of times a battery cell has been disconnected.\n# TYPE macos_battery_cell_disconnect_count gauge\nmacos_battery_cell_disconnect_count{serial=\"ZTMDHJEZ8JKMYVAJKU\"} 0\n# HELP macos_battery_charge_rate_amps Current charge rate in Ah.\n# TYPE macos_battery_charge_rate_amps gauge\nmacos_battery_charge_rate_amps{serial=\"ZTMDHJEZ8JKMYVAJKU\"} -1.004\n# HELP macos_battery_charge_rate_watts Current charge rate in Wh.\n# TYPE macos_battery_charge_rate_watts gauge\nmacos_battery_charge_rate_watts{serial=\"ZTMDHJEZ8JKMYVAJKU\"} -12.712648\n# HELP macos_battery_count Total number of batteries.\n# TYPE macos_battery_count gauge\nmacos_battery_count 1\n# HELP macos_battery_current_capacity_amps Current charge capacity in Ah.\n# TYPE macos_battery_current_capacity_amps gauge\nmacos_battery_current_capacity_amps{serial=\"ZTMDHJEZ8JKMYVAJKU\"} 5.39\n# HELP macos_battery_current_capacity_watts Current charge capacity in Wh.\n# TYPE macos_battery_current_capacity_watts gauge\nmacos_battery_current_capacity_watts{serial=\"ZTMDHJEZ8JKMYVAJKU\"} 68.24818\n# HELP macos_battery_current_percentage Current battery charge percentage.\n# TYPE macos_battery_current_percentage gauge\nmacos_battery_current_percentage{serial=\"ZTMDHJEZ8JKMYVAJKU\"} 91\n# HELP macos_battery_cycle_count Current battery cycle count.\n# TYPE macos_battery_cycle_count counter\nmacos_battery_cycle_count{serial=\"ZTMDHJEZ8JKMYVAJKU\"} 15\n# HELP macos_battery_design_capacity_amps Design capacity in Ah.\n# TYPE macos_battery_design_capacity_amps gauge\nmacos_battery_design_capacity_amps{serial=\"ZTMDHJEZ8JKMYVAJKU\"} 6.249\n# HELP macos_battery_design_capacity_watts Design capacity in Wh.\n# TYPE macos_battery_design_capacity_watts gauge\nmacos_battery_design_capacity_watts{serial=\"ZTMDHJEZ8JKMYVAJKU\"} 79.124838\n# HELP macos_battery_fully_charged Indicates if the battery is fully charged.\n# TYPE macos_battery_fully_charged gauge\nmacos_battery_fully_charged{serial=\"ZTMDHJEZ8JKMYVAJKU\"} 0\n# HELP macos_battery_health Battery health as a percentage (0-100%).\n# TYPE macos_battery_health gauge\nmacos_battery_health{serial=\"ZTMDHJEZ8JKMYVAJKU\"} 100\n# HELP macos_battery_info Basic details about the battery.\n# TYPE macos_battery_info gauge\nmacos_battery_info{built_in=\"true\",device_name=\"ayzo3hgs\",serial=\"ZTMDHJEZ8JKMYVAJKU\"} 1\n# HELP macos_battery_is_charging Indicates if the battery is currently charging.\n# TYPE macos_battery_is_charging gauge\nmacos_battery_is_charging{serial=\"ZTMDHJEZ8JKMYVAJKU\"} 0\n# HELP macos_battery_max_capacity_amps Design capacity in Ah.\n# TYPE macos_battery_max_capacity_amps gauge\nmacos_battery_max_capacity_amps{serial=\"ZTMDHJEZ8JKMYVAJKU\"} 6.271\n# HELP macos_battery_max_capacity_watts Design capacity in Wh.\n# TYPE macos_battery_max_capacity_watts gauge\nmacos_battery_max_capacity_watts{serial=\"ZTMDHJEZ8JKMYVAJKU\"} 79.403402\n# HELP macos_battery_temperature_celsius Current battery temperature in °C.\n# TYPE macos_battery_temperature_celsius gauge\nmacos_battery_temperature_celsius{serial=\"ZTMDHJEZ8JKMYVAJKU\"} 30.53\n# HELP macos_battery_time_remaining_seconds Estimated time remaining until battery is fully charged or discharged.\n# TYPE macos_battery_time_remaining_seconds gauge\nmacos_battery_time_remaining_seconds{serial=\"ZTMDHJEZ8JKMYVAJKU\"} 14040\n# HELP macos_battery_voltage_volts Current battery voltage in V.\n# TYPE macos_battery_voltage_volts gauge\nmacos_battery_voltage_volts{serial=\"ZTMDHJEZ8JKMYVAJKU\"} 12.662\n```\n\n### Write to File\n\n```bash\nmacos-battery-exporter -o battery.txt\n```\n\n### Run Server\n\n```bash\nmacos-battery-exporter -s\n```\n\n```bash\ncurl http://localhost:9108/metrics\n```\n\n## License\n\n[MIT](https://github.com/jimeh/macos-battery-exporter/blob/main/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimeh%2Fmacos-battery-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjimeh%2Fmacos-battery-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjimeh%2Fmacos-battery-exporter/lists"}