Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Branch: master

Merge pull request #4 from ctl80/patch-1

A couple grammar corrections to
latest commit d765420e7f
@davecheney authored

Go management extensions


go get

Getting started

Instrumenting your application with gmx is as simple as importing the gmx package in your main package via the side effect operator.

package main

import _ ""

By default gmx opens a unix socket in /tmp, the name of the socket is


Protocol version 0

The current protocol version is 0, which is a simple JSON based protocol. You can communicate with the gmx socket using a tool like socat.

% socat UNIX-CONNECT:/tmp/.gmx.$(pgrep godoc).0 stdin
["runtime.version", "runtime.numcpu"]
{"runtime.numcpu":4,"runtime.version":"weekly.2012-01-27 11688+"}

The request is a json array of strings representing keys that you wish to query. The result is a json map, the keys of that map are keys that matched the keys in your request. The value of the entry will be the result of the published function, encoded in json. If there is no matching key registered, no entry will appear in the result map.

For convenience a client is included in the gmxc sub directory. Please consult the README in that directory for more details.

Registering gmx keys

New keys can be registered using the Publish function

gmx.Publish(key string, f func() interface{})

f can be any function that returns a json encodable result. f is executed whenever its key is invoked, responsibility for ensuring the function is thread safe rests with the author of f.

Runtime instrumentation

By default gmx instruments selected values from the runtime and os packages, refer to the runtime.go and os.go source for more details.



  • gmx now honors the value of os.TempDir() when opening the unix socket
  • gmxc now accepts regexps for key names


  • Initial release
Something went wrong with that request. Please try again.