Skip to content

This library allows application to parse go structures to prometheus exposition format.

License

Notifications You must be signed in to change notification settings

paroscale/PrometheusGoHandler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 

Repository files navigation

A parser that parses go structures to prometheus exposition format. For now, we only support data models Counter, Gauge and Histogram.  
Note : This parsers only parses provide text output, Its responsibilty of the user to start the http service to publish
the text in /metrics.

- Constants Defined 
	HISTOGRAM 
	GAUGE 
	COUNTER
	UNTYPE

- Append data to variable of type HandlerStructure
```
    addToHandler = append(addToHandler, struct {
           MType    int
	   MName    string
           LabelMap map[string]string
           MValue   interface{}
    }{MType: prometheus_handler.GAUGE, MName: "Field1", MValue: 2, LabelMap: labelMap})
```

To use this library user has to pass the structure defined as per above guidelines and filled with values to following function
func GenericPromDataParser(structure HandlerStructure) string

About

This library allows application to parse go structures to prometheus exposition format.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors 4

  •  
  •  
  •  
  •  

Languages