Categorygithub.com/bygui86/go-metrics
modulepackage
0.0.0-20200405160905-a5c9f7b1d6ad
Repository: https://github.com/bygui86/go-metrics.git
Documentation: pkg.go.dev

# README

Go exporting metrics sample project

Run

Local

go run main.go

Docker

docker build . -t go-samples/echo-server:latest
docker run -d --name echo-server \
	-e KUBE_HOST="0.0.0.0" \
	-e MONITOR_HOST="0.0.0.0" \
	-e REST_HOST="0.0.0.0" \
	go-samples/echo-server:latest

Kubernetes

kubectl apply -f kube/

APIs

Echo server

:8080/echo
:8080/echo/{msg}

Prometheus metrics

:9090/metrics

Kubernetes probes

:9091/live
:9091/ready

Please note

Here we use promauto module instead of normal prometheus one, so we can avoid to manually register the Prometheus collector with kind of following command

prometheus.MustRegister(myCustomMetric)

Versions

version 0.0.1

  • simple rest apis
  • default metrics

version 0.0.2

  • multistage dockerfile
  • kubernetes manifests

version 0.0.3

  • custom metrics

version 0.0.4

  • improve monitoring-package segregation

Links

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author