Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Commit

Permalink
Merge pull request #15 from 8thlight/datadog
Browse files Browse the repository at this point in the history
add datadog monitoring for vdb
  • Loading branch information
TakaGoto authored Sep 11, 2018
2 parents d8d8386 + 552fedc commit 27c0cc7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand All @@ -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() {
Expand Down
3 changes: 3 additions & 0 deletions environments/staging.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ port = 5432

[client]
ipcPath = "/mnt/geth.ipc"

[datadog]
name = "maker_vdb_staging"
7 changes: 7 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

0 comments on commit 27c0cc7

Please sign in to comment.