mirror of
https://github.com/wahyd4/badger.git
synced 2026-08-09 05:15:58 +10:00
refine ddtrace
This commit is contained in:
@@ -3,20 +3,13 @@ module github.com/wahyd4/badger
|
||||
go 1.14
|
||||
|
||||
require (
|
||||
github.com/Microsoft/go-winio v0.5.1 // indirect
|
||||
github.com/ajstarks/svgo v0.0.0-20200320125537-f189e35d30ca
|
||||
github.com/getsentry/sentry-go v0.7.0
|
||||
github.com/gin-gonic/gin v1.6.3
|
||||
github.com/go-playground/validator/v10 v10.3.0 // indirect
|
||||
github.com/google/uuid v1.3.0 // indirect
|
||||
github.com/gin-gonic/gin v1.7.0
|
||||
github.com/jinzhu/gorm v1.9.16
|
||||
github.com/oklog/ulid v1.3.1
|
||||
github.com/opentracing/opentracing-go v1.2.0 // indirect
|
||||
github.com/philhofer/fwd v1.1.1 // indirect
|
||||
github.com/prometheus/client_golang v1.7.1
|
||||
github.com/prometheus/common v0.10.0
|
||||
github.com/sirupsen/logrus v1.7.0
|
||||
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
|
||||
gopkg.in/DataDog/dd-trace-go.v1 v1.33.0
|
||||
gopkg.in/yaml.v2 v2.3.0 // indirect
|
||||
gopkg.in/DataDog/dd-trace-go.v1 v1.37.0
|
||||
)
|
||||
|
||||
@@ -20,6 +20,7 @@ import (
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/wahyd4/badger/config"
|
||||
"github.com/wahyd4/badger/models"
|
||||
gintrace "gopkg.in/DataDog/dd-trace-go.v1/contrib/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type ColorScheme string
|
||||
@@ -41,7 +42,7 @@ func main() {
|
||||
|
||||
dbConfig := config.Config{
|
||||
Host: getEnvWithDefault("DB_HOST", "new-postgres-postgresql.db.svc.cluster.local"),
|
||||
Port: getEnvWithDefault("DB_PORT", "0000"),
|
||||
Port: getEnvWithDefault("DB_PORT", "5432"),
|
||||
DBName: getEnvWithDefault("DB_NAME", "badges_dev"),
|
||||
Username: getEnvWithDefault("DB_USERNAME", "someuser"),
|
||||
Password: getEnvWithDefault("DB_PASSWORD", "hahah"),
|
||||
@@ -91,6 +92,8 @@ func main() {
|
||||
Repanic: true,
|
||||
}))
|
||||
|
||||
r.Use(gintrace.Middleware(getEnvWithDefault("DB_NAME", "badges_dev")))
|
||||
|
||||
r.GET("/ping", func(c *gin.Context) {
|
||||
c.JSON(200, gin.H{"msg": "Hello!"})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user