-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
22 lines (19 loc) · 840 Bytes
/
README
File metadata and controls
22 lines (19 loc) · 840 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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