divan / expvarmon Goto Github PK
View Code? Open in Web Editor NEWTermUI based monitor for Go apps using expvars (/debug/vars). Quickest way to monitor your Go app(s).
License: MIT License
TermUI based monitor for Go apps using expvars (/debug/vars). Quickest way to monitor your Go app(s).
License: MIT License
Hi, great project!
I'm seeing some pretty severe rendering issues when I run expvarmon -ports="8000"
. It looks like this:
Resizing the window does not seem to fix it. Is there some terminal setting I should be aware of? The screenshot is from Ubuntu, running in an ssh session from a osx host (not sure if that's relevant at all).
Any ideas of what is going on?
Can I use something like -vars="*"
to get all expvars in given endpoint?
We have some expvars that are exported a dictionaries where the keys are IP addresses in dotted quad notation. Currently, AFAICT, these cannot be displayed by expvarmon.
The program I'm trying monitor exposes the expvars at the non-standard http://host:4985/_expvar
endpoint rather than the standard http://localhost:4985/debug/vars
endpoint.
I tried this but it didn't work:
expvarmon -ports="http://localhost:4985/_expvar"
no ports specified. Use -ports arg to specify ports of Go apps to monitor
Usage of expvarmon:
.. etc
As a feature request, would it be possible to add a new arg like -endpoint
which would customize how the endpoint URL is constructed?
Hi,
Given the following snippet:
package main
import (
"expvar"
"net/http"
)
func main() {
m := expvar.NewMap("test")
m.Add("\x00", 1)
http.ListenAndServe(":1234", nil)
}
Expvarmon stops showing results all together. You can add a sleep time before the add and observe it only happens when the string is added.
First up I love this tool, so thank you very much for providing it.
When I run --vars="mem:memstats.Alloc,mem:memstats.Sys,mem:memstats.HeapAlloc,mem:memstats.HeapInuse,duration:memstats.PauseNs,duration:memstats.PauseTotalNs,mem:memstats.HeapReleased,mem:memstats.TotalAlloc,mem:memstats.NumGC,mem:memstats.NextGC,mem:memstats.LastGC"
the NextGC and LastGC I think should come out as time stamps. Also the NumGC should just be a number, I don't think it needs a unit as it is just a count.
https://cl.ly/5a681f89e0b3 is a screen shot of the output I currently get. If pointed in the right direction here I would happily make a change and open a PR.
To install expvarmon it's mentioned in the documentation to use go get
which belongs to the pre-modules era
Now a days (since 2018 and Go 1.11) you need to use
go install github.com/divan/expvarmon@latest
and of cource having $GOPATH/bin
in $PATH
to be able to install this awesome app
hi, I have a question that does expvarmon have any way to serialize the expvar variable to file ? I want to save the variable from expvar and do analysis offline and generate chart based on there data.
Would be nice to be able to group panels like this:
./expvarmon -vars="foo,bar" -vars="fizz,buzz"
or even
./expvarmon -vars="Memory::foo,bar" -vars="CPU::fizz,buzz" #single colons may collide with expvar names for some
To connect to my remote API I have to provide a Token using the "Authorization" HTTP header:
curl -H 'Authorization: <my-secret-token>' https://api.example.com/v0/books
How can I provide such HTTP header to expvarmon?
Is this issue related to #23?
We have some rather large and deeply nested expvars. As a user, I would love to use globs instead of commands like this:
./expvarmon -vars="cb.ops.Write(raw).count,cb.ops.Write(raw).p99,cb.ops.Write(raw).p95,cb.ops.Write(raw).p90,cb.ops.Write(raw).p75,cb.ops.Write(raw).p50,cb.ops.Write(raw).p25"
For example, it would be great to instead be able to simply type:
./expvarmon -vars="cb.ops.Write(raw).*"
or even
./expvarmon -vars="cb.ops.*"
I'm curious if there is any way to use expvarmon inside my own program.
I want to deploy one binary on the server and give admin view what's going on.
e.g.
When I'll run
./my -expvarmon
it should run expvarmon tool with all variables set
I'm wondering which license applies to this repo.
Could you specify any to avoid issues with Laws interpretations?
If there's one announced somewhere, my apologies, but I couldn't find it.
Thanks for considering
I'm trying to run it on MacOs.
recieving this:
โ / expvarmon -ports="8181"
zsh: command not found: expvarmon
thanks
I've added custom vars to the JSON and they appear when viewing them in a browser.
{
"cmdine": {...},
"latency.p50": 125248.5,
"latency.p90": 614798.4545454546,
"latency.p95": 1019194.25,
"latency.p99": 2460674,
"memstats": {...}
}
When running expvarmon -ports="8181" -vars="duration:latency.p50,duration:latency.p90,duration:latency.p95,duration:latency.p99"
those values all appear as N/A
in the UI.
Am I doing something weird when running the command?
I can't find a way to monitor a variable located in an object inside an array, see the following JSON:
"Blah": {
"DeviceStatus": [
{
"Descr": "Foo",
"ConnectionStatus": false,
},
{
"Descr": "Bar",
"ConnectionStatus": false,
}
]
}
I tried with:
expvarmon -vars="Foo:Blah.DeviceStatus[0].ConnectionStatus"
but the UI gives me:
Blah.DeviceStatus[0].ConnectionStatus: N/A
Not sure if this is a transient error or a permanent error.
I can't seem to have it report the number of goroutines in my running process? I am using the vars="Goroutines". I do see memory stats
expvarmon -ports="4000" -vars="Goroutines,mem:memstats.HeapInuse"
Hi, really liked this project.
It has a future indeed. I have a Go server app running with a routing middleware that is not the net/http. After setting the import and "go get" the project, no data is collected within expvarmon. Is it because is not http routing ?
Many thanks
I have a number of stats that export as a duration string, such as:
"uptime": "32m48.4137762s"
or
"averagerequesttime": "67.6394ms"
These don't generate spark lines, nor are their max really valid. How about an additional var type, durationstr, that parses the duration back into an int64 for comparison/sparkline, but still displays with the duration string representation for labeling?
Hi,
can you help me with this... "go get github.com/divan/expvarmon" fails. I am attaching the output of failed installation.
Thanks,
Tomaz
We have an application that requires a specific HTTP header to be passed to expose certain counters via expvar.
I've hacked together a rudimentary solution at https://github.com/marklr/expvarmon -- if the code is up to @divan's standards, I'd be glad to submit a PR pending any cleanups/modifications.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.