Conversation
| | Hibernate| 5.x | Please check the following [JDBC instrumentation](#jdbc-instrumentation) section | | ||
| | [MongoDB](https://github.com/opentracing-contrib/java-mongo-driver) | 3.x | Intercepts all the calls from the MongoDB client | | ||
| | [Cassandra](https://github.com/opentracing-contrib/java-cassandra-driver) | 3.2.x | Intercepts all the calls from the Cassandra client | | ||
| | [Elasticsearch](https://github.com/opentracing-contrib/java-elasticsearch-client) | 5.4.x | Intercepts all the calls from the ES Transport client | |
There was a problem hiding this comment.
Currently not supported
There was a problem hiding this comment.
Yes let's work on it in another PR
|
I moved the 2 yaml files from dd-java-agent to dd-trace. The decorators are dd-trace stuff and automatically added when the tracer is initialized by the resolver. The dd-trace.yaml is more tricky. A part of the configuration is related to the dd-tracer (service name, writer, sampler) and another part is related to the java-agent (annotations, package ...) |
| matchingValue: java-aws-sdk | ||
| setValue: aws-client | ||
| - type: URLAsResourceName | ||
| # - type: URLAsResourceName # Performance issues, no URL generalisation |
There was a problem hiding this comment.
yes we may think to remove that one, or provide a different implementation. It would be great if in someway we can have something like /api/:id rather than /api/42, /api/43 and so on.
| | Hibernate| 5.x | Please check the following [JDBC instrumentation](#jdbc-instrumentation) section | | ||
| | [MongoDB](https://github.com/opentracing-contrib/java-mongo-driver) | 3.x | Intercepts all the calls from the MongoDB client | | ||
| | [Cassandra](https://github.com/opentracing-contrib/java-cassandra-driver) | 3.2.x | Intercepts all the calls from the Cassandra client | | ||
| | [Elasticsearch](https://github.com/opentracing-contrib/java-elasticsearch-client) | 5.4.x | Intercepts all the calls from the ES Transport client | |
There was a problem hiding this comment.
Yes let's work on it in another PR
| public DBComponent() { | ||
| super(); | ||
| this.setMatchingTag(Tags.COMPONENT.getKey()); | ||
| this.setMatchingTag(Tags.DB_TYPE.getKey()); |
There was a problem hiding this comment.
Great! considering that this value is set when using OT JDBC module, I think it's a great default.
|
|
||
| @Override | ||
| public boolean afterSetTag(DDSpanContext context, String tag, Object value) { | ||
| public boolean afterSetTag(final DDSpanContext context, final String tag, final Object value) { |
There was a problem hiding this comment.
Is a kind of optimization? why those arguments must be set as final?
There was a problem hiding this comment.
Actually, it's the save actions plugin rule. Final avoids some mistakes (but not all) related to object manipulations
| @@ -5,14 +5,8 @@ decorators: | |||
| matchingValue: java-okhttp | |||
| setValue: http-client | |||
| - type: DBComponent | |||
| matchingValue: java-mongo | |||
There was a problem hiding this comment.
By removing these values, it means that by default Tags.DB_TYPE is used even for Mongo right?
There was a problem hiding this comment.
I changed the behavior of this decorator.
Mongo, JDBC, Cassandra, ES decorate the DB_TYPE with the value we want.
So, I generalize the decorator.
Each time a DB_TYPE is set, the service name is set to the actual value.
This thing may change depending the way we provide a manual way to set the service name
| - type: HTTPComponent | ||
| matchingValue: java-aws-sdk | ||
| setValue: aws-client | ||
| - type: URLAsResourceName |
There was a problem hiding this comment.
At the moment I agree to remove it, since we should design better that one.
|
|
||
| @Override | ||
| public boolean afterSetTag(DDSpanContext context, String tag, Object value) { | ||
| public boolean afterSetTag(final DDSpanContext context, final String tag, final Object value) { |
| @@ -5,14 +5,8 @@ decorators: | |||
| matchingValue: java-okhttp | |||
| setValue: http-client | |||
| - type: DBComponent | |||
| matchingValue: java-mongo | |||
|
@palazzem I added some comments, let me know if I merge or not this PR |

The aim to this PR is to improve how user set the service name for each contribution.
2 things to do:
1/ Set a default service name for common contribution
2/Add the ability for the users to override these defaults and keep the decorators logic hidden for them