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

Moved jdbc-datasource instrumentation to Instrumenter API #3160

Merged

Conversation

mateuszrzeszutek
Copy link
Member

  • Changed span type from CLIENT to INTERNAL (we're creating a span for opening a connection, which isn't the same as sending a request; besides, sometimes opening a SQL connections sends a validation query - we'd end up with nested CLIENT spans this way)
  • Implemented code semantic conventions (code.namespace, code.function)

public final class DataSourceInstrumenters {
private static final String INSTRUMENTATION_NAME = "io.opentelemetry.javaagent.jdbc";

private static final Instrumenter<DataSource, Void> INSTRUMENTER;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would DataSource -> Method make sense?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried that first - but I got different class names in tests (method.getDeclaringClass() vs dataSource.getClass()). I thought that it's probably a bit better to use the actual data source type in the attribute value, not the abstract/base class type.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense 👍

@trask trask merged commit 5e4c568 into open-telemetry:main Jun 3, 2021
@mateuszrzeszutek mateuszrzeszutek deleted the jdbc-datasource-instrumenter branch June 3, 2021 08:22
robododge pushed a commit to robododge/opentelemetry-java-instrumentation that referenced this pull request Jun 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants