Skip to content

Commit

Permalink
feat: make service_name configurable through environment variable (#3589
Browse files Browse the repository at this point in the history
)

Co-authored-by: Anton Kolesnikov <anton.e.kolesnikov@gmail.com>
  • Loading branch information
ldvc and kolesnikovae authored Sep 25, 2024
1 parent 4451f69 commit 81317a3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/phlare/phlare.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,11 @@ func New(cfg Config) (*Phlare, error) {

if cfg.Tracing.Enabled {
// Setting the environment variable JAEGER_AGENT_HOST enables tracing
trace, err := wwtracing.NewFromEnv(fmt.Sprintf("pyroscope-%s", cfg.Target))
name := os.Getenv("JAEGER_SERVICE_NAME")
if name == "" {
name = fmt.Sprintf("pyroscope-%s", cfg.Target)
}
trace, err := wwtracing.NewFromEnv(name)
if err != nil {
level.Error(logger).Log("msg", "error in initializing tracing. tracing will not be enabled", "err", err)
}
Expand Down

0 comments on commit 81317a3

Please sign in to comment.