-
Given that we have a application that has three functions A, B and C, where A always calls B, B always calls C and C calls nothing else. In each of the function, a span is created using opentelemetry-go instrumentation. How can we correctly use go test to test that in one call of A, all three spans are created correctly? I noticed that we may use a otlp-collector to serve as a span collector, but I believe this is quite an overkill. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
You can use the provider oteltest package, which includes an InMemory Span Exporter. |
Beta Was this translation helpful? Give feedback.
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.