mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-03-30 00:46:42 +00:00
fix: systemname
This commit is contained in:
@@ -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,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user