Skip to content
Export Go Module information to Prometheus
Branch: master
Clone or download
Latest commit 62df5a0 Mar 9, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
.travis.yml Remove go 1.9 Mar 1, 2019
LICENSE Initial commit Feb 28, 2019
Makefile Fix go 1.10 build Feb 28, 2019 Update README Mar 9, 2019
go.mod Fix go 1.11 build Mar 1, 2019
go.sum Fix go 1.11 build Mar 1, 2019
prommod.go Change Metric Name Mar 9, 2019
prommod_go_1_12_test.go Fix Print template Mar 9, 2019
prommod_oldgo.go Rename package to prommod Feb 28, 2019
prommod_oldgo_test.go Improve tests Mar 9, 2019
prommod_test.go Improve tests Mar 9, 2019

prommod prommod FOSSA Status GoDoc


Export Go Module information to Prometheus.

Should work with any recent version of Go. Tested with Go versions starting 1.10.


go get

With modules:

GO111MODULE=on; go get


import (


func main() {

	http.Handle("/metrics", promhttp.Handler())

	log.Fatal(http.ListenAndServe(":8080", nil))

Example Metric Output

# HELP go_mod_info A metric with a constant '1' value labeled by dependency name, version, from which app_name was built.
# TYPE go_mod_info gauge
go_mod_info{name="",program="app_name",version="v0.0.0-20180321164747-3a771d992973"} 1
go_mod_info{name="",program="app_name",version="v1.2.0"} 1
go_mod_info{name="",program="app_name",version="v1.0.1"} 1
go_mod_info{name="",program="app_name",version="v0.0.11-0.20190309143328-e661980fc053"} 1
go_mod_info{name="",program="app_name",version="v0.9.2"} 1
go_mod_info{name="",program="app_name",version="v0.0.0-20180712105110-5c3871d89910"} 1
go_mod_info{name="",program="app_name",version="v0.0.0-20181126121408-4724e9255275"} 1
go_mod_info{name="",program="app_name",version="v0.0.0-20181204211112-1dc9a6cbc91a"} 1

Example Print



app_name v0.0.0-20180321164747-3a771d992973 v1.2.0 v1.0.1 v0.0.3 v0.9.2 v0.0.0-20180712105110-5c3871d89910 v0.0.0-20181126121408-4724e9255275 v0.0.0-20181204211112-1dc9a6cbc91a

Example Info



( v0.0.0-20180321164747-3a771d992973, v1.2.0, v1.0.1, v0.0.5, v0.9.2, v0.0.0-20180712105110-5c3871d89910, v0.0.0-20181126121408-4724e9255275, v0.0.0-20181204211112-1dc9a6cbc91a)


FOSSA Status

You can’t perform that action at this time.