Skip to content

larytet-py/prometheus-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 

Repository files navigation

prometheus-python

This package is similar to https://github.com/larytet-go/prometheus-golang

Given a structure

class Statistics:
	@prometheus("1s tick implemented in the code")
	ticker = 0
	@prometheus("Count of hits of the HTTP server, includes debug interfaces")
	hits = 0  
	@prometheus("Count of the API calls")
	hitApi = 0
	@prometheus("Number of 5xx errors returned by the API")
	status5xx = 0
}

Call to prometheus_structure() returns

HELP ticker 1s tick implemented in the code
TYPE ticker counter
ticker 0
HELP hits Count of hits of the HTTP server, includes debug interfaces
TYPE hits counter
hits 1
HELP hitApi 
TYPE hitApi counter
hitApi 0
HELP status5xx 
TYPE status5xx counter
status5xx 0

which is accidentally what Prometheus would generate

You can also initialize a structure of Prometheus counters

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published