wavefrontHQ / go-metrics-wavefront

Wavefront plugin for go-metrics
https://wavefront.com
Apache License 2.0
11 stars 15 forks source link

Start/stop wavefrontReporter function #11

Closed sliu2013 closed 5 years ago

sliu2013 commented 6 years ago

According to README.md, currently we use goroutine or a long-lasting func() to have the wavefrontReporter (either proxy or direct-ingestion)

  go wavefront.WavefrontDirect(metrics.DefaultRegistry, 5*time.Second, hostTags, "direct.prefix", server, token)

I need to use channel (maybe considered as a hacky way) to stop the wavefrontReporter. It would be nice if we can stop the reporter by calling a stop() function. Also, maybe we can consider to have some abstraction, so the users only need to call wavefront.WavefrontReporter() instead of WavefrontDirect and WavefrontProxy respectively.

vikramraman commented 5 years ago

Addressed in the latest refactoring.