Skip to content

How to test the instrumentation in an application using Golang test? #2891

Answered by dmathieu
ethernoy asked this question in Q&A
Discussion options

You must be logged in to vote

You can use the provider oteltest package, which includes an InMemory Span Exporter.
Configure your tracer provider with that exporter, run your code. And all spans will be available with the GetSpans method.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@ethernoy
Comment options

@dmathieu
Comment options

@sdavispluto
Comment options

@dmathieu
Comment options

Answer selected by ethernoy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants