Skip to content

patrickmamaid/go_instrumentation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

[Boilerplate] Prometheus instrumentation in go

golang v1.18

Goal:

img.png img_1.png

EST: 5 mins to understand and use

Very quick boilerplate code to get you going on golang instrumentation with prometheus

  1. Easily expose :2112/metrics for any service you want (you can change this port in main.go)
  2. Paste into your implementation and make any modifications you deem necessary, this should get you going really quickly

init:

# terminal 1 
./init.sh
./run.sh

# terminal 2
./curltest.sh

Requirements:

brew install watch

Quick notes:

main.go creates a basic counter pmapp_infinite_ops_2s_total:

  • every 2s, counter++
  • grep it out by doing curl -s http://localhost:2112/metrics | grep pmapp_infinite_ops_2s_total / or run curltest.sh

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published