Merge pull request #15 from 8thlight/datadog
add datadog monitoring for vdb
This commit is contained in:
commit
d4a4748246
@ -17,6 +17,7 @@ Vulcanize DB is a set of tools that make it easier for developers to write appli
|
|||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
`go get github.com/vulcanize/vulcanizedb`
|
`go get github.com/vulcanize/vulcanizedb`
|
||||||
|
`go get gopkg.in/DataDog/dd-trace-go.v1/ddtrace`
|
||||||
|
|
||||||
## Setting up the Database
|
## Setting up the Database
|
||||||
1. Install Postgres
|
1. Install Postgres
|
||||||
|
@ -70,6 +70,7 @@ func init() {
|
|||||||
rootCmd.PersistentFlags().String("database-password", "", "database password")
|
rootCmd.PersistentFlags().String("database-password", "", "database password")
|
||||||
rootCmd.PersistentFlags().String("client-ipcPath", "", "location of geth.ipc file")
|
rootCmd.PersistentFlags().String("client-ipcPath", "", "location of geth.ipc file")
|
||||||
rootCmd.PersistentFlags().String("client-levelDbPath", "", "location of levelDb chaindata")
|
rootCmd.PersistentFlags().String("client-levelDbPath", "", "location of levelDb chaindata")
|
||||||
|
rootCmd.PersistentFlags().String("datadog-name", "vulcanize-test", "datadog service name")
|
||||||
|
|
||||||
viper.BindPFlag("database.name", rootCmd.PersistentFlags().Lookup("database-name"))
|
viper.BindPFlag("database.name", rootCmd.PersistentFlags().Lookup("database-name"))
|
||||||
viper.BindPFlag("database.port", rootCmd.PersistentFlags().Lookup("database-port"))
|
viper.BindPFlag("database.port", rootCmd.PersistentFlags().Lookup("database-port"))
|
||||||
@ -78,6 +79,7 @@ func init() {
|
|||||||
viper.BindPFlag("database.password", rootCmd.PersistentFlags().Lookup("database-password"))
|
viper.BindPFlag("database.password", rootCmd.PersistentFlags().Lookup("database-password"))
|
||||||
viper.BindPFlag("client.ipcPath", rootCmd.PersistentFlags().Lookup("client-ipcPath"))
|
viper.BindPFlag("client.ipcPath", rootCmd.PersistentFlags().Lookup("client-ipcPath"))
|
||||||
viper.BindPFlag("client.levelDbPath", rootCmd.PersistentFlags().Lookup("client-levelDbPath"))
|
viper.BindPFlag("client.levelDbPath", rootCmd.PersistentFlags().Lookup("client-levelDbPath"))
|
||||||
|
viper.BindPFlag("datadog.name", rootCmd.PersistentFlags().Lookup("datadog-name"))
|
||||||
}
|
}
|
||||||
|
|
||||||
func initConfig() {
|
func initConfig() {
|
||||||
|
@ -7,3 +7,6 @@ port = 5432
|
|||||||
|
|
||||||
[client]
|
[client]
|
||||||
ipcPath = "/mnt/geth.ipc"
|
ipcPath = "/mnt/geth.ipc"
|
||||||
|
|
||||||
|
[datadog]
|
||||||
|
name = "maker_vdb_staging"
|
7
main.go
7
main.go
@ -2,8 +2,15 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/vulcanize/vulcanizedb/cmd"
|
"github.com/vulcanize/vulcanizedb/cmd"
|
||||||
|
|
||||||
|
"gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer"
|
||||||
|
"github.com/spf13/viper"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
tracer.Start(tracer.WithServiceName(viper.GetString("datadog.name")))
|
||||||
|
|
||||||
cmd.Execute()
|
cmd.Execute()
|
||||||
|
|
||||||
|
defer tracer.Stop()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user