{"id":13724084,"url":"https://github.com/divan/expvarmon","last_synced_at":"2025-05-15T12:03:36.480Z","repository":{"id":31351705,"uuid":"34914513","full_name":"divan/expvarmon","owner":"divan","description":"TermUI based monitor for Go apps using expvars (/debug/vars). Quickest way to monitor your Go app(s).","archived":false,"fork":false,"pushed_at":"2023-11-14T02:21:16.000Z","size":1110,"stargazers_count":2034,"open_issues_count":16,"forks_count":99,"subscribers_count":49,"default_branch":"master","last_synced_at":"2025-04-14T19:59:30.615Z","etag":null,"topics":[],"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/divan.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}},"created_at":"2015-05-01T17:28:29.000Z","updated_at":"2025-04-11T10:02:26.000Z","dependencies_parsed_at":"2024-02-03T13:51:36.619Z","dependency_job_id":null,"html_url":"https://github.com/divan/expvarmon","commit_stats":{"total_commits":104,"total_committers":6,"mean_commits":"17.333333333333332","dds":0.06730769230769229,"last_synced_commit":"8bf297f0fa5dfc8e4509746bb34112a432b7a624"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divan%2Fexpvarmon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divan%2Fexpvarmon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divan%2Fexpvarmon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divan%2Fexpvarmon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/divan","download_url":"https://codeload.github.com/divan/expvarmon/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254337612,"owners_count":22054253,"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":[],"created_at":"2024-08-03T01:01:49.862Z","updated_at":"2025-05-15T12:03:36.456Z","avatar_url":"https://github.com/divan.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# ExpvarMon\n\nTermUI based Go apps monitor using [expvars](http://golang.org/pkg/expvar/) variables (/debug/vars). Quickest way to monitor your Go app.\n\n## Introduction\n\nGo apps console monitoring tool. Minimal configuration efforts. Quick and easy monitoring solution for one or multiple services.\n\n## Features\n\n* Single- and multi-apps mode\n* Local and remote apps support\n* HTTP and HTTPS endpoints, including Basic Auth support\n* Arbitrary number of apps and vars to monitor (from 1 to 30+, depends on size of your terminal)\n* Track restarted/failed apps\n* Show maximum value\n* Supports: Integer, float, duration, memory, string, bool, array variables\n* Sparkline charts for integer, duration and memory data\n* Auto-resize on font-size change or window resize\n* Uses amazing [TermUI](https://github.com/gizak/termui) library by [gizak](https://github.com/gizak)\n\n## Demo\n\n### Multiple apps mode\n\u003cimg src=\"./demo/demo_multi.png\" alt=\"Multi mode\" width=\"800\"\u003e\n\n### Single app mode\n\u003cimg src=\"./demo/demo_single.png\" alt=\"Single mode\" width=\"800\"\u003e\n\nYou can monitor arbitrary number of services and variables:\n\n\u003ca href=\"./demo/demo_1var.png\" target=\"_blank\"\u003e\u003cimg src=\"./demo/demo_1var.png\" alt=\"1 var\" width=\"350\"\u003e\u003c/a\u003e \u003ca href=\"./demo/demo_small.png\" target=\"_blank\"\u003e\u003cimg src=\"./demo/demo_small.png\" alt=\"25 apps\" width=\"350\"\u003e\u003c/a\u003e\n\n## Purpose\n\nThis app targets debug/develop sessions when you need an instant way to monitor you app(s). It's not intended to monitor apps in production.\nAlso it doesn't use any storage engines and doesn't send notifications.\n\n## Install\n\nJust run go get:\n\n    go install github.com/divan/expvarmon@latest\n\n## Usage\n\n### Prepare your app\n\nFirst, you have to add [expvars](http://golang.org/pkg/expvar/) support into your Go program. It's as simple as:\n\n    import _ \"expvar\"\n\nand note the port your app is listening on. If it's not, just add two lines:\n\n    import \"net/http\"\n    ...\n    http.ListenAndServe(\":1234\", nil)\n\nand expvar will add handler for \"localhost:1234/debug/vars\" to your app.\n\nBy default, expvars adds two variables: *memstats* and *cmdline*. It's enough to monitor memory and garbage collector status in your app.\n\n### Run expvarmon\n\nJust run expvarmon with -ports=\"1234\" flag:\n\n    expvarmon -ports=\"1234\"\n    \nThat's it.\n\nMore examples:\n\n    ./expvarmon -ports=\"80\"\n    ./expvarmon -ports=\"23000-23010,http://example.com:80-81\" -i=1m\n    ./expvarmon -ports=\"80,remoteapp:80\" -vars=\"mem:memstats.Alloc,duration:Response.Mean,Counter\"\n    ./expvarmon -ports=\"1234-1236\" -vars=\"Goroutines\" -self\n    ./expvarmon -ports=\"https://user:pass@my.remote.app.com:443\" -vars=\"Goroutines\" -self\n\n## Advanced usage\n\nIf you need to monitor more (or less) vars, you can specify them with -vars command line flag.\n\n    $ no ports specified. Use -ports arg to specify ports of Go apps to monitor\n\tUsage of ./expvarmon:\n\t  -dummy\n\t    \tUse dummy (console) output\n\t  -endpoint string\n\t    \tURL endpoint for expvars (default \"/debug/vars\")\n\t  -i duration\n\t    \tPolling interval (default 5s)\n\t  -ports string\n\t    \tPorts/URLs for accessing services expvars (start-end,port2,port3,https://host:port)\n\t  -self\n\t    \tMonitor itself\n\t  -vars string\n\t    \tVars to monitor (comma-separated) (default \"mem:memstats.Alloc,mem:memstats.Sys,mem:memstats.HeapAlloc,mem:memstats.HeapInuse,duration:memstats.PauseNs,duration:memstats.PauseTotalNs\")\n\n\tExamples:\n\t\t./expvarmon -ports=\"80\"\n\t\t./expvarmon -ports=\"23000-23010,http://example.com:80-81\" -i=1m\n\t\t./expvarmon -ports=\"80,remoteapp:80\" -vars=\"mem:memstats.Alloc,duration:Response.Mean,Counter\"\n\t\t./expvarmon -ports=\"1234-1236\" -vars=\"Goroutines\" -self\n\n\tFor more details and docs, see README: http://github.com/divan/expvarmon\n\n\nSo, yes, you can specify multiple ports, using '-' for ranges, and specify fully-qualified URLs for remote apps. To override default URL endpoint (\"/debug/vars\"), use -endpoint flag.\n\nYou can also monitor expvarmon itself, using -self flag.\n\n### Basic Auth\n\nIf your expvar endpoint is protected by Basic Auth, you have two options:\n\n - Set environmental variables *HTTP_USER* and *HTTP_PASSWORD* accordingly. These values will be applied to each endpoint.\n - Embed your credentials to URL via command line flag: `-ports=\"http://user:pass@myapp:1234\"`\n\n### Vars\n\nExpvarmon doesn't restrict you to monitor only memstats. You can publish your own counters and variables using [expvar.Publish()](http://golang.org/pkg/expvar/#Publish) method or using expvar wrappers libraries. Just pass your variables names as they appear in JSON to -var command line flag.\n\nNotation is dot-separated, for example: **memstats.Alloc** for .MemStats.Alloc field. Quick link to runtime.MemStats documentation: http://golang.org/pkg/runtime/#MemStats\n\nExpvar allows to export only basic types - structs, ints, floats, arrays (int or float), bools and strings. For arrays, average will be calculated. Ints are used for sparklines, and displayed as is. But you can specify modifier to make sure it will be rendered properly.\n\nVars are specified as a comma-separated list of var identifiers with (optional) modifiers.\n\n| Modifier | Description |\n| --------- | ----------- |\n| mem:      | renders int64 as memory string (KB, MB, etc) |\n| duration: | renders int64 as time.Duration (1s, 2ms, 12h23h) |\n| str:      | doesn't display sparklines chart for this value, just display as string |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivan%2Fexpvarmon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdivan%2Fexpvarmon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivan%2Fexpvarmon/lists"}