aboutsummaryrefslogtreecommitdiff
path: root/backend/main.go
diff options
context:
space:
mode:
authorArda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>2025-07-24 14:09:11 +0300
committerGitHub <noreply@github.com>2025-07-24 14:09:11 +0300
commit7746337964fd50b2eac170333efa05e7a5676a1c (patch)
tree5485c7a8ad89f5bc2af653b349acd710997421ee /backend/main.go
parentfix/rankings: remove debug return (diff)
downloadlphub-7746337964fd50b2eac170333efa05e7a5676a1c.tar.gz
lphub-7746337964fd50b2eac170333efa05e7a5676a1c.tar.bz2
lphub-7746337964fd50b2eac170333efa05e7a5676a1c.zip
feat/backend: add newrelic integration (#274)
Diffstat (limited to '')
-rw-r--r--backend/main.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/backend/main.go b/backend/main.go
index a1a4a20..e422359 100644
--- a/backend/main.go
+++ b/backend/main.go
@@ -11,6 +11,8 @@ import (
11 11
12 "github.com/gin-gonic/gin" 12 "github.com/gin-gonic/gin"
13 "github.com/joho/godotenv" 13 "github.com/joho/godotenv"
14 nrgin "github.com/newrelic/go-agent/v3/integrations/nrgin"
15 "github.com/newrelic/go-agent/v3/newrelic"
14) 16)
15 17
16// @title Least Portals Hub 18// @title Least Portals Hub
@@ -30,7 +32,16 @@ func main() {
30 if os.Getenv("ENV") == "PROD" { 32 if os.Getenv("ENV") == "PROD" {
31 gin.SetMode(gin.ReleaseMode) 33 gin.SetMode(gin.ReleaseMode)
32 } 34 }
35 app, err := newrelic.NewApplication(
36 newrelic.ConfigAppName("lphub"),
37 newrelic.ConfigLicense(os.Getenv("NEWRELIC_LICENSE_KEY")),
38 newrelic.ConfigAppLogForwardingEnabled(true),
39 )
40 if err != nil {
41 log.Fatal("Error instrumenting newrelic")
42 }
33 router := gin.Default() 43 router := gin.Default()
44 router.Use(nrgin.Middleware(app))
34 database.ConnectDB() 45 database.ConnectDB()
35 api.InitRoutes(router) 46 api.InitRoutes(router)
36 // for debugging 47 // for debugging