Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If sc.Telemetry.Disabled=true, trace.StopAgent will panic. #3979

Closed
ansoda opened this issue Mar 6, 2024 · 1 comment
Closed

If sc.Telemetry.Disabled=true, trace.StopAgent will panic. #3979

ansoda opened this issue Mar 6, 2024 · 1 comment

Comments

@ansoda
Copy link
Contributor

ansoda commented Mar 6, 2024

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior, if applicable:

  1. The code is

    func (sc ServiceConf) SetUp() error {
     if len(sc.Log.ServiceName) == 0 {
     	sc.Log.ServiceName = sc.Name
     }
     if err := logx.SetUp(sc.Log); err != nil {
     	return err
     }
    
     sc.initMode()
     prometheus.StartAgent(sc.Prometheus)
    
     if len(sc.Telemetry.Name) == 0 {
     	sc.Telemetry.Name = sc.Name
     }
     trace.StartAgent(sc.Telemetry)
     proc.AddShutdownListener(func() {
     	trace.StopAgent()
     })
    
     if len(sc.MetricsUrl) > 0 {
     	stat.SetReportWriter(stat.NewRemoteWriter(sc.MetricsUrl))
     }
     devserver.StartAgent(sc.DevServer)
    
     return nil
    }
  2. The error is

If sc.Telemetry.Disabled=true, trace.StopAgent will panic.

@chenquan
Copy link
Member

chenquan commented Mar 6, 2024

Can you submit a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants