From 1168ddf9f9cde0bff06e0641c0e749d9d3223d29 Mon Sep 17 00:00:00 2001 From: Seefs Date: Fri, 19 Dec 2025 22:27:35 +0800 Subject: [PATCH] fix: systemname --- common/pyro.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/common/pyro.go b/common/pyro.go index 4fb4f7bb7..9891bac1c 100644 --- a/common/pyro.go +++ b/common/pyro.go @@ -1,7 +1,6 @@ package common import ( - "os" "runtime" "github.com/grafana/pyroscope-go" @@ -9,18 +8,20 @@ import ( func StartPyroScope() error { - pyroscopeUrl := os.Getenv("PYROSCOPE_URL") + pyroscopeUrl := GetEnvOrDefaultString("PYROSCOPE_URL", "") if pyroscopeUrl == "" { return nil } + pyroscopeAppName := GetEnvOrDefaultString("PYROSCOPE_APP_NAME", "new-api") + // These 2 lines are only required if you're using mutex or block profiling // Read the explanation below for how to set these rates: runtime.SetMutexProfileFraction(5) runtime.SetBlockProfileRate(5) _, err := pyroscope.Start(pyroscope.Config{ - ApplicationName: SystemName, + ApplicationName: pyroscopeAppName, ServerAddress: pyroscopeUrl,