{"id":40381536,"url":"https://github.com/c-ehrlich/enter-the-metrix","last_synced_at":"2026-01-22T14:35:57.723Z","repository":{"id":332972516,"uuid":"1135572247","full_name":"c-ehrlich/enter-the-metrix","owner":"c-ehrlich","description":"tiny daemon: mac vitals -\u003e otlp -\u003e axiom","archived":false,"fork":false,"pushed_at":"2026-01-16T15:52:44.000Z","size":63,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-17T04:56:50.406Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/c-ehrlich.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-16T09:37:05.000Z","updated_at":"2026-01-16T21:17:44.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/c-ehrlich/enter-the-metrix","commit_stats":null,"previous_names":["c-ehrlich/metrix"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/c-ehrlich/enter-the-metrix","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c-ehrlich%2Fenter-the-metrix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c-ehrlich%2Fenter-the-metrix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c-ehrlich%2Fenter-the-metrix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c-ehrlich%2Fenter-the-metrix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/c-ehrlich","download_url":"https://codeload.github.com/c-ehrlich/enter-the-metrix/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/c-ehrlich%2Fenter-the-metrix/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28633747,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T04:47:28.174Z","status":"ssl_error","status_checked_at":"2026-01-21T04:47:22.943Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-01-20T12:03:10.877Z","updated_at":"2026-01-21T13:00:59.993Z","avatar_url":"https://github.com/c-ehrlich.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Enter the metrix\n\nA lightweight macOS daemon that exports system metrics via OpenTelemetry (OTLP).\n\n## Features\n\n- Minimal resource footprint\n- Easy installation on any Mac\n- Proper macOS service integration via launchd\n- Configurable metrics collection and export\n- Interactive setup wizard\n\n## Prerequisites\n\n- macOS\n- [Bun](https://bun.sh) runtime (`curl -fsSL https://bun.sh/install | bash`)\n\n## Quick Start\n\n```bash\n# 1. Clone and build\ngit clone https://github.com/c-ehrlich/metrix.git\ncd metrix\nbun install\nbun run build\n\n# 2. Configure your OTLP endpoint\n./dist/metrix setup\n\n# 3. Test metrics collection\n./dist/metrix --dry-run\n\n# 4. Install as background service\n./scripts/install.sh\n\n# 5. Verify it's running\nmetrix status\n```\n\n## Installation\n\n### Using the Install Script\n\nAfter building and configuring (steps 1-2 above):\n\n```bash\n./scripts/install.sh\n```\n\nThis copies the binary to `/usr/local/bin` and sets up a launchd service that runs in the background.\n\n### Manual Installation\n\n```bash\n# Copy binary to /usr/local/bin\nsudo cp ./dist/metrix /usr/local/bin/\n\n# Install launchd service\ncp ./launchd/co.metrix.agent.plist ~/Library/LaunchAgents/\nlaunchctl load ~/Library/LaunchAgents/co.metrix.agent.plist\n\n# Verify\nmetrix status\n```\n\n### Uninstall\n\n```bash\n./scripts/uninstall.sh\n```\n\n## Configuration\n\n### Interactive Setup\n\nRun the setup wizard to configure your OTLP endpoint (do this before installing the service):\n\n```bash\nmetrix setup\n```\n\n### Configuration File\n\nConfig location: `~/.config/metrix/config.json`\n\n```json\n{\n  \"interval\": 10,\n  \"otlp\": {\n    \"endpoint\": \"https://api.axiom.co/v1/metrics\",\n    \"headers\": {\n      \"Authorization\": \"Bearer your-token-here\",\n      \"X-Axiom-Dataset\": \"system-metrics\"\n    }\n  },\n  \"metrics\": {\n    \"cpu\": true,\n    \"memory\": true,\n    \"disk\": true,\n    \"network\": true,\n    \"load\": true,\n    \"swap\": true,\n    \"battery\": true,\n    \"diskIo\": true,\n    \"uptime\": true,\n    \"thermal\": true,\n    \"wifi\": true,\n    \"bluetooth\": true,\n    \"display\": true,\n    \"fan\": true\n  }\n}\n```\n\n### CLI Overrides\n\nAll config values can be overridden via CLI flags:\n\n```bash\nmetrix --interval 5\nmetrix --endpoint \"https://...\"\nmetrix --header \"Authorization=Bearer xxx\" --header \"X-Custom=value\"\nmetrix --config /path/to/config.json\nmetrix --dry-run  # Print metrics to stdout instead of exporting\n```\n\n## Usage\n\n```\nUsage: metrix [command] [options]\n\nCommands:\n  setup     Interactive configuration wizard\n  status    Check if the metrix service is running\n\nOptions:\n  -i, --interval \u003cseconds\u003e  Collection interval (default: 10)\n  -e, --endpoint \u003curl\u003e      OTLP endpoint URL\n  -H, --header \u003ckey=value\u003e  Add header (can be repeated)\n  -c, --config \u003cpath\u003e       Path to config file\n  -d, --dry-run             Print metrics to stdout instead of exporting\n  --debug                   Save last request to ~/metrix.txt\n  -h, --help                Show this help message\n```\n\n### Check Service Status\n\n```bash\nmetrix status\n```\n\n### Test Metrics Collection\n\n```bash\nmetrix --dry-run\n```\n\n## Metrics\n\nAll metrics follow OpenTelemetry semantic conventions.\n\n| Metric | Type | Description |\n|--------|------|-------------|\n| `system.cpu.utilization` | Gauge | CPU usage (0-1) |\n| `system.cpu.load_average` | Gauge | Load average (1m, 5m, 15m) |\n| `system.memory.usage` | Gauge | Memory in use (bytes) |\n| `system.memory.available` | Gauge | Memory available (bytes) |\n| `system.memory.utilization` | Gauge | Memory usage (0-1) |\n| `system.disk.usage` | Gauge | Disk space used (bytes) |\n| `system.disk.available` | Gauge | Disk space available (bytes) |\n| `system.disk.utilization` | Gauge | Disk usage (0-1) |\n| `system.disk.io` | Counter | Bytes read/written |\n| `system.disk.operations` | Counter | Read/write operations |\n| `system.network.io` | Counter | Bytes transmitted/received |\n| `system.swap.usage` | Gauge | Swap space used (bytes) |\n| `system.swap.available` | Gauge | Swap space available (bytes) |\n| `system.swap.utilization` | Gauge | Swap usage (0-1) |\n| `system.battery.charge` | Gauge | Battery charge level (0-1) |\n| `system.battery.charging` | Gauge | Charging state (0/1) |\n| `system.battery.cycle_count` | Gauge | Battery cycle count |\n| `system.uptime` | Gauge | Time since boot (seconds) |\n| `system.thermal.state` | Gauge | Thermal state (0-3) |\n| `system.wifi.signal_strength` | Gauge | Wi-Fi RSSI (dBm) |\n| `system.bluetooth.connected_devices` | Gauge | Connected Bluetooth devices |\n| `system.display.brightness` | Gauge | Display brightness (0-1) |\n| `system.fan.speed` | Gauge | Fan speed (rpm) |\n\n## Axiom Integration\n\nTo send metrics to [Axiom](https://axiom.co):\n\n1. Create an API token in Axiom\n2. Create a dataset for your metrics\n3. Configure metrix:\n\n```json\n{\n  \"otlp\": {\n    \"endpoint\": \"https://api.axiom.co/v1/metrics\",\n    \"headers\": {\n      \"Authorization\": \"Bearer xaat-your-token-here\",\n      \"X-Axiom-Dataset\": \"your-dataset-name\"\n    }\n  }\n}\n```\n\n## launchd Service\n\nThe service is managed via launchd:\n\n- Plist: `~/Library/LaunchAgents/co.metrix.agent.plist`\n- Logs: `~/Library/Logs/metrix.log`\n- Starts on login\n- Restarts automatically on crash\n\n### Manual Service Control\n\n```bash\n# Stop\nlaunchctl unload ~/Library/LaunchAgents/co.metrix.agent.plist\n\n# Start\nlaunchctl load ~/Library/LaunchAgents/co.metrix.agent.plist\n\n# Check status\nlaunchctl list | grep metrix\n```\n\n## Development\n\n```bash\n# Install dependencies\nbun install\n\n# Run in development mode\nbun run dev\n\n# Build binary\nbun run build\n\n# Type check\nbun run typecheck\n\n# Lint\nbun run lint\n\n# Format\nbun run format\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc-ehrlich%2Fenter-the-metrix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fc-ehrlich%2Fenter-the-metrix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fc-ehrlich%2Fenter-the-metrix/lists"}