Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move tracer() method from Tracer class to Instrumentation #1622

Closed
iNikem opened this issue Nov 11, 2020 · 2 comments
Closed

Move tracer() method from Tracer class to Instrumentation #1622

iNikem opened this issue Nov 11, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@iNikem
Copy link
Contributor

iNikem commented Nov 11, 2020

One of the asks from #566 is the ability to add new attributes to spans. These attributes may depend on the same actual objects that Tracers operate on, such as http request or db connection. Thus this cannot be done in SpanProcessor and vendor distros should be able to override Tracer implementation.

But atm instrumentations access tracer instance via static method on tracer class:

public class JdbcTracer extends DatabaseClientTracer<DBInfo, SqlStatementInfo> {
  private static final JdbcTracer TRACER = new JdbcTracer();

  public static JdbcTracer tracer() {
    return TRACER;
  }

This makes overriding impossible. I propose to make tracer() an instance method on either instrumentation or advice.

@trask
Copy link
Member

trask commented Nov 11, 2020

@iNikem is this same as #778?

@iNikem
Copy link
Contributor Author

iNikem commented Nov 12, 2020

I will close this issue as #778 and #1623 probably supersede this one.

@iNikem iNikem closed this as completed Nov 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants