census-ecosystem / opencensus-go-exporter-stackdriver

OpenCensus Go exporter for Stackdriver Monitoring and Trace
Apache License 2.0
67 stars 79 forks source link

Exporter.Flush does not flush #232

Closed filipzyzniewski-fexco closed 4 years ago

filipzyzniewski-fexco commented 4 years ago

Please answer these questions before submitting a bug report.

What version of the Exporter are you using?

9366d3634e70bea85a87d33f6f23e5f9c673f8fa, v0.12.7

What version of OpenCensus are you using?

opencensus-go-exporter-stackdriver $ go list -m go.opencensus.io go.opencensus.io v0.22.1 opencensus-go-exporter-stackdriver $

What version of Go are you using?

$ go version go version go1.13.3 darwin/amd64 $

What did you do?

https://github.com/filipzyzniewski-fexco/opencensus-go-exporter-stackdriver/commit/1c06b105fa97a2a24c0df96e71983b8b22f84874 :

opencensus-go-exporter-stackdriver $ go run examples/stats/main.go
2019/10/30 18:39:51 Flushing explictly
2019/10/30 18:39:51 Wait longer than the reporting duration...
2019/10/30 18:40:52 entering statsExporter.uploadMetrics
2019/10/30 18:41:51 Done waiting
opencensus-go-exporter-stackdriver $

What did you expect to see?

"entering statsExporter.uploadMetrics" message shortly after the "Flushing explictly" message

What did you see instead?

"entering statsExporter.uploadMetrics" message after the reporting interval has passed

Additional context

Perhaps this is WAI - if so, could godoc of https://godoc.org/contrib.go.opencensus.io/exporter/stackdriver#Exporter.Flush explicitly state that it won't upload metrics?

Also - please note how I had to bump up the sleep up from 1 minute at https://github.com/filipzyzniewski-fexco/opencensus-go-exporter-stackdriver/commit/1c06b105fa97a2a24c0df96e71983b8b22f84874#diff-6f40325426fabdac95ad42f50bf87ba1R79 - otherwise the stats example never tried to upload the metrics, as it returned before the upload kicked in - please see timestamps above: 2019/10/30 18:39:51 Wait longer than the reporting duration... 2019/10/30 18:40:52 entering statsExporter.uploadMetrics there is an additional second of delay before upload kicks in - perhaps the example should be updated?

filipzyzniewski-fexco commented 4 years ago

Actually, it's a duplicate of https://github.com/census-ecosystem/opencensus-go-exporter-stackdriver/issues/43