Closed trask closed 1 year ago
hi @rkennedy-mode! I think this is a great use-case for the project to support. We have some nice infra for running the javaagent during tests for this repository and checking the resulting spans. It seems that this could be extended/useful for this use case. We are currently working toward stabilizing the Instrumenter API for external usage, but have started thinking about tackling the same for the testing infra after that.
Hello @trask! I have a similar question in Stackoverflow, maybe I can help to implement this? I have thoughts about moving the custom memory exporter from the agent-for-testing
module inside the main agent and just adding the in-memory exporting mode (like oltp
, jaeger
, etc.). And add some testing module that allows to register/deregister this agent in the test's JVM with this mode and APIs to verify the exporter's logic.
Or I think if there are difficulties with sharing the data in memory between tests and the agent we could implement some sort of file exporter and export the data in the temp folder in the tests and read it from this directory afterward 🤔
@aivinog1 check out https://github.com/open-telemetry/opentelemetry-java-docs/issues/42 for a nice alternative
@aivinog1 check out open-telemetry/opentelemetry-java-docs#42 for a nice alternative
Thanks, actually this is a good idea 👍
Closing, I think https://github.com/open-telemetry/opentelemetry-java-examples/tree/main/telemetry-testing is a good minimal testing example
Creating an issue from this discussion because this sounds like a great use-case for the project to support in the future.
Discussed in https://github.com/open-telemetry/opentelemetry-java-instrumentation/discussions/4550