-
Notifications
You must be signed in to change notification settings - Fork 327
trace: exporter for unit testing #293
Comments
We will probably need similar things for |
Adding it to R2 for now, we will move it to R3 if we can't deliver. The Go style is having the testing packages near the actual package, see net/http and net/http/httptest. We should have a trace/tracetest and stats/statstest. Not sure if we need to provide anything for the tag package for testing. |
Hi there! I've been working on implementing OpenCensus, and would like to unit test to make sure metrics are being sent over to exporters correctly. Has there been any traction on this? |
Not that I know of. I think partially the reason is that the interface is so simple to implement that most people just create an implementation themselves in test code. |
This is true, but there's another part required to trigger the exporter, which I didn't realise until just now after looking through the test code here: it's best to unregister the view to trigger the exporting. opencensus-go/plugin/ochttp/route_test.go Line 53 in 7c76463
Before, I was trying to trigger exporting with I'd love it if such a test exporter would automatically do this, or some variant, so the test doesn't have to trigger exporting =) |
Supply a
trace.Exporter
useful for testing that just collects all spans and events in memory for later validation.The text was updated successfully, but these errors were encountered: