Initial commit
This commit is contained in:
25
metric/examples/exporter_demo.go
Normal file
25
metric/examples/exporter_demo.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"globalfintech/golib/metric"
|
||||
)
|
||||
|
||||
func main() {
|
||||
cfg := metric.ExporterCfg{
|
||||
Listener: nil,
|
||||
RegisterConsul: false,
|
||||
ProductName: "ProductName_001",
|
||||
ServiceRegion: "ServiceRegion_001",
|
||||
AppName: "AppName_001",
|
||||
}
|
||||
|
||||
go func() {
|
||||
if err := metric.InitExporter(cfg); err != nil {
|
||||
fmt.Println("prometheus exporter stopped,err: ", err)
|
||||
}
|
||||
}()
|
||||
fmt.Println("prometheus exporter started")
|
||||
|
||||
select {}
|
||||
}
|
||||
Reference in New Issue
Block a user