Skip to content

sureshopsgeek/demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Counter service

The counter service exposes two http endpoints namely counter and metrics through two different http servers. The counter endpoint accepts the response code and increment the internal counter for the response code. The metrics endpoint exposes the counter for each response code which can be scaped by prometheus.

Command-line arguments

The service binary accepts the following command line arguments

   -v  bool  set to enable verbose logging, default: false
   -cp int   counter server port, default: 8080
   -mp int   metric server port, default: 9201

Starting the service

Following command will start the service in verbose mode and the servers will run on non default ports passed through the flags.

   counter -v -cp 8082 -mp 9203

Sending response code to counter endpoint

The counter endpoint accepts the response code in a json body through PUT method.

   curl -XPUT http://demohost:8082/counter -d '{"code": 401 }'

Checking the metrics endpoint

   curl -XGET http://demohost:9203/metrics

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published