Merge pull request #15 from 8thlight/datadog

add datadog monitoring for vdb
This commit is contained in:
Takayuki Goto 2018-09-11 12:15:27 -05:00 committed by GitHub
commit d4a4748246
4 changed files with 13 additions and 0 deletions

View File

@ -17,6 +17,7 @@ Vulcanize DB is a set of tools that make it easier for developers to write appli
## Installation
`go get github.com/vulcanize/vulcanizedb`
`go get gopkg.in/DataDog/dd-trace-go.v1/ddtrace`
## Setting up the Database
1. Install Postgres

View File

@ -70,6 +70,7 @@ func init() {
rootCmd.PersistentFlags().String("database-password", "", "database password")
rootCmd.PersistentFlags().String("client-ipcPath", "", "location of geth.ipc file")
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.port", rootCmd.PersistentFlags().Lookup("database-port"))
@ -78,6 +79,7 @@ func init() {
viper.BindPFlag("database.password", rootCmd.PersistentFlags().Lookup("database-password"))
viper.BindPFlag("client.ipcPath", rootCmd.PersistentFlags().Lookup("client-ipcPath"))
viper.BindPFlag("client.levelDbPath", rootCmd.PersistentFlags().Lookup("client-levelDbPath"))
viper.BindPFlag("datadog.name", rootCmd.PersistentFlags().Lookup("datadog-name"))
}
func initConfig() {

View File

@ -7,3 +7,6 @@ port = 5432
[client]
ipcPath = "/mnt/geth.ipc"
[datadog]
name = "maker_vdb_staging"

View File

@ -2,8 +2,15 @@ package main
import (
"github.com/vulcanize/vulcanizedb/cmd"
"gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer"
"github.com/spf13/viper"
)
func main() {
tracer.Start(tracer.WithServiceName(viper.GetString("datadog.name")))
cmd.Execute()
defer tracer.Stop()
}