open-telemetry / opentelemetry-java-instrumentation

OpenTelemetry auto-instrumentation and instrumentation libraries for Java

Home Page:https://opentelemetry.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Share code and tests with contrib instrumentation

trask opened this issue · comments

Some things we could probably share with contrib instrumentation:

  • The decorator hierarchy
  • HttpTextFormat Getters and Setters
  • OkHttp3 interceptor
  • MongoDB listener
  • tests!

If there's agreement on the direction for this issue, I could help do some moving. Perhaps I could start by moving the decorators into opentelemetry-java?

Hi @anuraaga, help on this would be great!

I think it will be easier to share code and tests between auto and manual instrumentation if they are in the same repo, at least short-term while we are figuring out how to share.

Have a look at #195. I think the first step is to take one of the simpler instrumentations, and extract out the generic bits using that model.

You'll end up with 3 modules: one module with the generic parts, one module with the manual instrumentation, and (the existing) module with the auto-instrumentation that now depends on the module with the generic parts.

We definitely want to share tests between manual and auto-instrumentation as well, so that's another challenge to work through with this first instrumentation.

Closing this now, good progress is being made on this in several other issues and PRs. And this issue has outlived its usefulness.